176 #ifndef PY_SSIZE_T_CLEAN
177 #define PY_SSIZE_T_CLEAN
181 #error Python headers needed to compile C extensions, please install development version of Python.
182 #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000)
183 #error Cython requires Python 2.6+ or Python 3.3+.
185 #define CYTHON_ABI "0_29_36"
186 #define CYTHON_HEX_VERSION 0x001D24F0
187 #define CYTHON_FUTURE_DIVISION 1
190 #define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
192 #if !defined(WIN32) && !defined(MS_WINDOWS)
204 #define DL_IMPORT(t) t
207 #define DL_EXPORT(t) t
209 #define __PYX_COMMA ,
210 #ifndef HAVE_LONG_LONG
211 #if PY_VERSION_HEX >= 0x02070000
212 #define HAVE_LONG_LONG
216 #define PY_LONG_LONG LONG_LONG
219 #define Py_HUGE_VAL HUGE_VAL
222 #define CYTHON_COMPILING_IN_PYPY 1
223 #define CYTHON_COMPILING_IN_PYSTON 0
224 #define CYTHON_COMPILING_IN_CPYTHON 0
225 #define CYTHON_COMPILING_IN_NOGIL 0
226 #undef CYTHON_USE_TYPE_SLOTS
227 #define CYTHON_USE_TYPE_SLOTS 0
228 #undef CYTHON_USE_PYTYPE_LOOKUP
229 #define CYTHON_USE_PYTYPE_LOOKUP 0
230 #if PY_VERSION_HEX < 0x03050000
231 #undef CYTHON_USE_ASYNC_SLOTS
232 #define CYTHON_USE_ASYNC_SLOTS 0
233 #elif !defined(CYTHON_USE_ASYNC_SLOTS)
234 #define CYTHON_USE_ASYNC_SLOTS 1
236 #undef CYTHON_USE_PYLIST_INTERNALS
237 #define CYTHON_USE_PYLIST_INTERNALS 0
238 #undef CYTHON_USE_UNICODE_INTERNALS
239 #define CYTHON_USE_UNICODE_INTERNALS 0
240 #undef CYTHON_USE_UNICODE_WRITER
241 #define CYTHON_USE_UNICODE_WRITER 0
242 #undef CYTHON_USE_PYLONG_INTERNALS
243 #define CYTHON_USE_PYLONG_INTERNALS 0
244 #undef CYTHON_AVOID_BORROWED_REFS
245 #define CYTHON_AVOID_BORROWED_REFS 1
246 #undef CYTHON_ASSUME_SAFE_MACROS
247 #define CYTHON_ASSUME_SAFE_MACROS 0
248 #undef CYTHON_UNPACK_METHODS
249 #define CYTHON_UNPACK_METHODS 0
250 #undef CYTHON_FAST_THREAD_STATE
251 #define CYTHON_FAST_THREAD_STATE 0
252 #undef CYTHON_FAST_PYCALL
253 #define CYTHON_FAST_PYCALL 0
254 #if PY_VERSION_HEX < 0x03090000
255 #undef CYTHON_PEP489_MULTI_PHASE_INIT
256 #define CYTHON_PEP489_MULTI_PHASE_INIT 0
257 #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT)
258 #define CYTHON_PEP489_MULTI_PHASE_INIT 1
260 #undef CYTHON_USE_TP_FINALIZE
261 #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1 && PYPY_VERSION_NUM >= 0x07030C00)
262 #undef CYTHON_USE_DICT_VERSIONS
263 #define CYTHON_USE_DICT_VERSIONS 0
264 #undef CYTHON_USE_EXC_INFO_STACK
265 #define CYTHON_USE_EXC_INFO_STACK 0
266 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
267 #define CYTHON_UPDATE_DESCRIPTOR_DOC 0
269 #elif defined(PYSTON_VERSION)
270 #define CYTHON_COMPILING_IN_PYPY 0
271 #define CYTHON_COMPILING_IN_PYSTON 1
272 #define CYTHON_COMPILING_IN_CPYTHON 0
273 #define CYTHON_COMPILING_IN_NOGIL 0
274 #ifndef CYTHON_USE_TYPE_SLOTS
275 #define CYTHON_USE_TYPE_SLOTS 1
277 #undef CYTHON_USE_PYTYPE_LOOKUP
278 #define CYTHON_USE_PYTYPE_LOOKUP 0
279 #undef CYTHON_USE_ASYNC_SLOTS
280 #define CYTHON_USE_ASYNC_SLOTS 0
281 #undef CYTHON_USE_PYLIST_INTERNALS
282 #define CYTHON_USE_PYLIST_INTERNALS 0
283 #ifndef CYTHON_USE_UNICODE_INTERNALS
284 #define CYTHON_USE_UNICODE_INTERNALS 1
286 #undef CYTHON_USE_UNICODE_WRITER
287 #define CYTHON_USE_UNICODE_WRITER 0
288 #undef CYTHON_USE_PYLONG_INTERNALS
289 #define CYTHON_USE_PYLONG_INTERNALS 0
290 #ifndef CYTHON_AVOID_BORROWED_REFS
291 #define CYTHON_AVOID_BORROWED_REFS 0
293 #ifndef CYTHON_ASSUME_SAFE_MACROS
294 #define CYTHON_ASSUME_SAFE_MACROS 1
296 #ifndef CYTHON_UNPACK_METHODS
297 #define CYTHON_UNPACK_METHODS 1
299 #undef CYTHON_FAST_THREAD_STATE
300 #define CYTHON_FAST_THREAD_STATE 0
301 #undef CYTHON_FAST_PYCALL
302 #define CYTHON_FAST_PYCALL 0
303 #undef CYTHON_PEP489_MULTI_PHASE_INIT
304 #define CYTHON_PEP489_MULTI_PHASE_INIT 0
305 #undef CYTHON_USE_TP_FINALIZE
306 #define CYTHON_USE_TP_FINALIZE 0
307 #undef CYTHON_USE_DICT_VERSIONS
308 #define CYTHON_USE_DICT_VERSIONS 0
309 #undef CYTHON_USE_EXC_INFO_STACK
310 #define CYTHON_USE_EXC_INFO_STACK 0
311 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
312 #define CYTHON_UPDATE_DESCRIPTOR_DOC 0
314 #elif defined(PY_NOGIL)
315 #define CYTHON_COMPILING_IN_PYPY 0
316 #define CYTHON_COMPILING_IN_PYSTON 0
317 #define CYTHON_COMPILING_IN_CPYTHON 0
318 #define CYTHON_COMPILING_IN_NOGIL 1
319 #ifndef CYTHON_USE_TYPE_SLOTS
320 #define CYTHON_USE_TYPE_SLOTS 1
322 #undef CYTHON_USE_PYTYPE_LOOKUP
323 #define CYTHON_USE_PYTYPE_LOOKUP 0
324 #ifndef CYTHON_USE_ASYNC_SLOTS
325 #define CYTHON_USE_ASYNC_SLOTS 1
327 #undef CYTHON_USE_PYLIST_INTERNALS
328 #define CYTHON_USE_PYLIST_INTERNALS 0
329 #ifndef CYTHON_USE_UNICODE_INTERNALS
330 #define CYTHON_USE_UNICODE_INTERNALS 1
332 #undef CYTHON_USE_UNICODE_WRITER
333 #define CYTHON_USE_UNICODE_WRITER 0
334 #undef CYTHON_USE_PYLONG_INTERNALS
335 #define CYTHON_USE_PYLONG_INTERNALS 0
336 #ifndef CYTHON_AVOID_BORROWED_REFS
337 #define CYTHON_AVOID_BORROWED_REFS 0
339 #ifndef CYTHON_ASSUME_SAFE_MACROS
340 #define CYTHON_ASSUME_SAFE_MACROS 1
342 #ifndef CYTHON_UNPACK_METHODS
343 #define CYTHON_UNPACK_METHODS 1
345 #undef CYTHON_FAST_THREAD_STATE
346 #define CYTHON_FAST_THREAD_STATE 0
347 #undef CYTHON_FAST_PYCALL
348 #define CYTHON_FAST_PYCALL 0
349 #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
350 #define CYTHON_PEP489_MULTI_PHASE_INIT 1
352 #ifndef CYTHON_USE_TP_FINALIZE
353 #define CYTHON_USE_TP_FINALIZE 1
355 #undef CYTHON_USE_DICT_VERSIONS
356 #define CYTHON_USE_DICT_VERSIONS 0
357 #undef CYTHON_USE_EXC_INFO_STACK
358 #define CYTHON_USE_EXC_INFO_STACK 0
360 #define CYTHON_COMPILING_IN_PYPY 0
361 #define CYTHON_COMPILING_IN_PYSTON 0
362 #define CYTHON_COMPILING_IN_CPYTHON 1
363 #define CYTHON_COMPILING_IN_NOGIL 0
364 #ifndef CYTHON_USE_TYPE_SLOTS
365 #define CYTHON_USE_TYPE_SLOTS 1
367 #if PY_VERSION_HEX < 0x02070000
368 #undef CYTHON_USE_PYTYPE_LOOKUP
369 #define CYTHON_USE_PYTYPE_LOOKUP 0
370 #elif !defined(CYTHON_USE_PYTYPE_LOOKUP)
371 #define CYTHON_USE_PYTYPE_LOOKUP 1
373 #if PY_MAJOR_VERSION < 3
374 #undef CYTHON_USE_ASYNC_SLOTS
375 #define CYTHON_USE_ASYNC_SLOTS 0
376 #elif !defined(CYTHON_USE_ASYNC_SLOTS)
377 #define CYTHON_USE_ASYNC_SLOTS 1
379 #if PY_VERSION_HEX < 0x02070000
380 #undef CYTHON_USE_PYLONG_INTERNALS
381 #define CYTHON_USE_PYLONG_INTERNALS 0
382 #elif !defined(CYTHON_USE_PYLONG_INTERNALS)
383 #define CYTHON_USE_PYLONG_INTERNALS (PY_VERSION_HEX < 0x030C00A5)
385 #ifndef CYTHON_USE_PYLIST_INTERNALS
386 #define CYTHON_USE_PYLIST_INTERNALS 1
388 #ifndef CYTHON_USE_UNICODE_INTERNALS
389 #define CYTHON_USE_UNICODE_INTERNALS 1
391 #if PY_VERSION_HEX < 0x030300F0 || PY_VERSION_HEX >= 0x030B00A2
392 #undef CYTHON_USE_UNICODE_WRITER
393 #define CYTHON_USE_UNICODE_WRITER 0
394 #elif !defined(CYTHON_USE_UNICODE_WRITER)
395 #define CYTHON_USE_UNICODE_WRITER 1
397 #ifndef CYTHON_AVOID_BORROWED_REFS
398 #define CYTHON_AVOID_BORROWED_REFS 0
400 #ifndef CYTHON_ASSUME_SAFE_MACROS
401 #define CYTHON_ASSUME_SAFE_MACROS 1
403 #ifndef CYTHON_UNPACK_METHODS
404 #define CYTHON_UNPACK_METHODS 1
406 #if PY_VERSION_HEX >= 0x030B00A4
407 #undef CYTHON_FAST_THREAD_STATE
408 #define CYTHON_FAST_THREAD_STATE 0
409 #elif !defined(CYTHON_FAST_THREAD_STATE)
410 #define CYTHON_FAST_THREAD_STATE 1
412 #ifndef CYTHON_FAST_PYCALL
413 #define CYTHON_FAST_PYCALL (PY_VERSION_HEX < 0x030A0000)
415 #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
416 #define CYTHON_PEP489_MULTI_PHASE_INIT (PY_VERSION_HEX >= 0x03050000)
418 #ifndef CYTHON_USE_TP_FINALIZE
419 #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1)
421 #ifndef CYTHON_USE_DICT_VERSIONS
422 #define CYTHON_USE_DICT_VERSIONS ((PY_VERSION_HEX >= 0x030600B1) && (PY_VERSION_HEX < 0x030C00A5))
424 #if PY_VERSION_HEX >= 0x030B00A4
425 #undef CYTHON_USE_EXC_INFO_STACK
426 #define CYTHON_USE_EXC_INFO_STACK 0
427 #elif !defined(CYTHON_USE_EXC_INFO_STACK)
428 #define CYTHON_USE_EXC_INFO_STACK (PY_VERSION_HEX >= 0x030700A3)
430 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
431 #define CYTHON_UPDATE_DESCRIPTOR_DOC 1
434 #if !defined(CYTHON_FAST_PYCCALL)
435 #define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1)
437 #if CYTHON_USE_PYLONG_INTERNALS
438 #if PY_MAJOR_VERSION < 3
439 #include "longintrepr.h"
445 enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P ==
sizeof(
void*)) };
448 #ifndef __has_attribute
449 #define __has_attribute(x) 0
451 #ifndef __has_cpp_attribute
452 #define __has_cpp_attribute(x) 0
454 #ifndef CYTHON_RESTRICT
455 #if defined(__GNUC__)
456 #define CYTHON_RESTRICT __restrict__
457 #elif defined(_MSC_VER) && _MSC_VER >= 1400
458 #define CYTHON_RESTRICT __restrict
459 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
460 #define CYTHON_RESTRICT restrict
462 #define CYTHON_RESTRICT
465 #ifndef CYTHON_UNUSED
466 # if defined(__GNUC__)
467 # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
468 # define CYTHON_UNUSED __attribute__ ((__unused__))
470 # define CYTHON_UNUSED
472 # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
473 # define CYTHON_UNUSED __attribute__ ((__unused__))
475 # define CYTHON_UNUSED
478 #ifndef CYTHON_MAYBE_UNUSED_VAR
479 # if defined(__cplusplus)
480 template<
class T>
void CYTHON_MAYBE_UNUSED_VAR(
const T& ) { }
482 # define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x)
485 #ifndef CYTHON_NCP_UNUSED
486 # if CYTHON_COMPILING_IN_CPYTHON
487 # define CYTHON_NCP_UNUSED
489 # define CYTHON_NCP_UNUSED CYTHON_UNUSED
492 #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)
494 #ifndef _MSC_STDINT_H_
496 typedef unsigned char uint8_t;
497 typedef unsigned int uint32_t;
499 typedef unsigned __int8 uint8_t;
500 typedef unsigned __int32 uint32_t;
506 #ifndef CYTHON_FALLTHROUGH
507 #if defined(__cplusplus) && __cplusplus >= 201103L
508 #if __has_cpp_attribute(fallthrough)
509 #define CYTHON_FALLTHROUGH [[fallthrough]]
510 #elif __has_cpp_attribute(clang::fallthrough)
511 #define CYTHON_FALLTHROUGH [[clang::fallthrough]]
512 #elif __has_cpp_attribute(gnu::fallthrough)
513 #define CYTHON_FALLTHROUGH [[gnu::fallthrough]]
516 #ifndef CYTHON_FALLTHROUGH
517 #if __has_attribute(fallthrough)
518 #define CYTHON_FALLTHROUGH __attribute__((fallthrough))
520 #define CYTHON_FALLTHROUGH
523 #if defined(__clang__ ) && defined(__apple_build_version__)
524 #if __apple_build_version__ < 7000000
525 #undef CYTHON_FALLTHROUGH
526 #define CYTHON_FALLTHROUGH
532 #error "Cython files generated with the C++ option must be compiled with a C++ compiler."
534 #ifndef CYTHON_INLINE
535 #if defined(__clang__)
536 #define CYTHON_INLINE __inline__ __attribute__ ((__unused__))
538 #define CYTHON_INLINE inline
542 void __Pyx_call_destructor(T& x) {
546 class __Pyx_FakeReference {
548 __Pyx_FakeReference() : ptr(NULL) { }
549 __Pyx_FakeReference(
const T& ref) : ptr(const_cast<T*>(&ref)) { }
550 T *operator->() {
return ptr; }
551 T *operator&() {
return ptr; }
552 operator T&() {
return *ptr; }
553 template<
typename U>
bool operator ==(U other) {
return *ptr == other; }
554 template<
typename U>
bool operator !=(U other) {
return *ptr != other; }
559 #define __PYX_BUILD_PY_SSIZE_T "n"
560 #define CYTHON_FORMAT_SSIZE_T "z"
561 #if PY_MAJOR_VERSION < 3
562 #define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
563 #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
564 PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
565 #define __Pyx_DefaultClassType PyClass_Type
567 #define __Pyx_BUILTIN_MODULE_NAME "builtins"
568 #define __Pyx_DefaultClassType PyType_Type
569 #if PY_VERSION_HEX >= 0x030B00A1
570 static CYTHON_INLINE PyCodeObject* __Pyx_PyCode_New(
int a,
int k,
int l,
int s,
int f,
571 PyObject *code, PyObject *c, PyObject* n, PyObject *v,
572 PyObject *fv, PyObject *cell, PyObject* fn,
573 PyObject *name,
int fline, PyObject *lnos) {
574 PyObject *kwds=NULL, *argcount=NULL, *posonlyargcount=NULL, *kwonlyargcount=NULL;
575 PyObject *nlocals=NULL, *stacksize=NULL, *flags=NULL, *replace=NULL, *call_result=NULL, *empty=NULL;
576 const char *fn_cstr=NULL;
577 const char *name_cstr=NULL;
578 PyCodeObject* co=NULL;
579 PyObject *type, *value, *traceback;
580 PyErr_Fetch(&type, &value, &traceback);
581 if (!(kwds=PyDict_New()))
goto end;
582 if (!(argcount=PyLong_FromLong(a)))
goto end;
583 if (PyDict_SetItemString(kwds,
"co_argcount", argcount) != 0)
goto end;
584 if (!(posonlyargcount=PyLong_FromLong(0)))
goto end;
585 if (PyDict_SetItemString(kwds,
"co_posonlyargcount", posonlyargcount) != 0)
goto end;
586 if (!(kwonlyargcount=PyLong_FromLong(k)))
goto end;
587 if (PyDict_SetItemString(kwds,
"co_kwonlyargcount", kwonlyargcount) != 0)
goto end;
588 if (!(nlocals=PyLong_FromLong(l)))
goto end;
589 if (PyDict_SetItemString(kwds,
"co_nlocals", nlocals) != 0)
goto end;
590 if (!(stacksize=PyLong_FromLong(s)))
goto end;
591 if (PyDict_SetItemString(kwds,
"co_stacksize", stacksize) != 0)
goto end;
592 if (!(flags=PyLong_FromLong(f)))
goto end;
593 if (PyDict_SetItemString(kwds,
"co_flags", flags) != 0)
goto end;
594 if (PyDict_SetItemString(kwds,
"co_code", code) != 0)
goto end;
595 if (PyDict_SetItemString(kwds,
"co_consts", c) != 0)
goto end;
596 if (PyDict_SetItemString(kwds,
"co_names", n) != 0)
goto end;
597 if (PyDict_SetItemString(kwds,
"co_varnames", v) != 0)
goto end;
598 if (PyDict_SetItemString(kwds,
"co_freevars", fv) != 0)
goto end;
599 if (PyDict_SetItemString(kwds,
"co_cellvars", cell) != 0)
goto end;
600 if (PyDict_SetItemString(kwds,
"co_linetable", lnos) != 0)
goto end;
601 if (!(fn_cstr=PyUnicode_AsUTF8AndSize(fn, NULL)))
goto end;
602 if (!(name_cstr=PyUnicode_AsUTF8AndSize(name, NULL)))
goto end;
603 if (!(co = PyCode_NewEmpty(fn_cstr, name_cstr, fline)))
goto end;
604 if (!(replace = PyObject_GetAttrString((PyObject*)co,
"replace")))
goto cleanup_code_too;
605 if (!(empty = PyTuple_New(0)))
goto cleanup_code_too;
606 if (!(call_result = PyObject_Call(replace, empty, kwds)))
goto cleanup_code_too;
607 Py_XDECREF((PyObject*)co);
608 co = (PyCodeObject*)call_result;
612 Py_XDECREF((PyObject*)co);
617 Py_XDECREF(argcount);
618 Py_XDECREF(posonlyargcount);
619 Py_XDECREF(kwonlyargcount);
621 Py_XDECREF(stacksize);
623 Py_XDECREF(call_result);
626 PyErr_Restore(type, value, traceback);
631 #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
632 PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
634 #define __Pyx_DefaultClassType PyType_Type
636 #if PY_VERSION_HEX >= 0x030900F0 && !CYTHON_COMPILING_IN_PYPY
637 #define __Pyx_PyObject_GC_IsFinalized(o) PyObject_GC_IsFinalized(o)
639 #define __Pyx_PyObject_GC_IsFinalized(o) _PyGC_FINALIZED(o)
641 #ifndef Py_TPFLAGS_CHECKTYPES
642 #define Py_TPFLAGS_CHECKTYPES 0
644 #ifndef Py_TPFLAGS_HAVE_INDEX
645 #define Py_TPFLAGS_HAVE_INDEX 0
647 #ifndef Py_TPFLAGS_HAVE_NEWBUFFER
648 #define Py_TPFLAGS_HAVE_NEWBUFFER 0
650 #ifndef Py_TPFLAGS_HAVE_FINALIZE
651 #define Py_TPFLAGS_HAVE_FINALIZE 0
653 #ifndef METH_STACKLESS
654 #define METH_STACKLESS 0
656 #if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL)
657 #ifndef METH_FASTCALL
658 #define METH_FASTCALL 0x80
660 typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *
self, PyObject *
const *args, Py_ssize_t nargs);
661 typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *
self, PyObject *
const *args,
662 Py_ssize_t nargs, PyObject *kwnames);
664 #define __Pyx_PyCFunctionFast _PyCFunctionFast
665 #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords
667 #if CYTHON_FAST_PYCCALL
668 #define __Pyx_PyFastCFunction_Check(func)\
669 ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS)))))
671 #define __Pyx_PyFastCFunction_Check(func) 0
673 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc)
674 #define PyObject_Malloc(s) PyMem_Malloc(s)
675 #define PyObject_Free(p) PyMem_Free(p)
676 #define PyObject_Realloc(p) PyMem_Realloc(p)
678 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030400A1
679 #define PyMem_RawMalloc(n) PyMem_Malloc(n)
680 #define PyMem_RawRealloc(p, n) PyMem_Realloc(p, n)
681 #define PyMem_RawFree(p) PyMem_Free(p)
683 #if CYTHON_COMPILING_IN_PYSTON
684 #define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co)
685 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno)
687 #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
688 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno)
690 #if !CYTHON_FAST_THREAD_STATE || PY_VERSION_HEX < 0x02070000
691 #define __Pyx_PyThreadState_Current PyThreadState_GET()
692 #elif PY_VERSION_HEX >= 0x03060000
693 #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet()
694 #elif PY_VERSION_HEX >= 0x03000000
695 #define __Pyx_PyThreadState_Current PyThreadState_GET()
697 #define __Pyx_PyThreadState_Current _PyThreadState_Current
699 #if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT)
700 #include "pythread.h"
701 #define Py_tss_NEEDS_INIT 0
702 typedef int Py_tss_t;
703 static CYTHON_INLINE
int PyThread_tss_create(Py_tss_t *key) {
704 *key = PyThread_create_key();
707 static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(
void) {
708 Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(
sizeof(Py_tss_t));
709 *key = Py_tss_NEEDS_INIT;
712 static CYTHON_INLINE
void PyThread_tss_free(Py_tss_t *key) {
715 static CYTHON_INLINE
int PyThread_tss_is_created(Py_tss_t *key) {
716 return *key != Py_tss_NEEDS_INIT;
718 static CYTHON_INLINE
void PyThread_tss_delete(Py_tss_t *key) {
719 PyThread_delete_key(*key);
720 *key = Py_tss_NEEDS_INIT;
722 static CYTHON_INLINE
int PyThread_tss_set(Py_tss_t *key,
void *value) {
723 return PyThread_set_key_value(*key, value);
725 static CYTHON_INLINE
void * PyThread_tss_get(Py_tss_t *key) {
726 return PyThread_get_key_value(*key);
729 #if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized)
730 #define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n))
732 #define __Pyx_PyDict_NewPresized(n) PyDict_New()
734 #if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION
735 #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
736 #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
738 #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y)
739 #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y)
741 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && CYTHON_USE_UNICODE_INTERNALS
742 #define __Pyx_PyDict_GetItemStr(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash)
744 #define __Pyx_PyDict_GetItemStr(dict, name) PyDict_GetItem(dict, name)
746 #if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
747 #define CYTHON_PEP393_ENABLED 1
748 #if PY_VERSION_HEX >= 0x030C0000
749 #define __Pyx_PyUnicode_READY(op) (0)
751 #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\
752 0 : _PyUnicode_Ready((PyObject *)(op)))
754 #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u)
755 #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
756 #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u)
757 #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u)
758 #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u)
759 #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i)
760 #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, ch)
761 #if PY_VERSION_HEX >= 0x030C0000
762 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_LENGTH(u))
764 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03090000
765 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : ((PyCompactUnicodeObject *)(u))->wstr_length))
767 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u)))
771 #define CYTHON_PEP393_ENABLED 0
772 #define PyUnicode_1BYTE_KIND 1
773 #define PyUnicode_2BYTE_KIND 2
774 #define PyUnicode_4BYTE_KIND 4
775 #define __Pyx_PyUnicode_READY(op) (0)
776 #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u)
777 #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i]))
778 #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535 : 1114111)
779 #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE))
780 #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u))
781 #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i]))
782 #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = ch)
783 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u))
785 #if CYTHON_COMPILING_IN_PYPY
786 #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b)
787 #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b)
789 #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b)
790 #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\
791 PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b))
793 #if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains)
794 #define PyUnicode_Contains(u, s) PySequence_Contains(u, s)
796 #if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check)
797 #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type)
799 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format)
800 #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt)
802 #define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyString_Check(b) && !PyString_CheckExact(b)))) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b))
803 #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
804 #if PY_MAJOR_VERSION >= 3
805 #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b)
807 #define __Pyx_PyString_Format(a, b) PyString_Format(a, b)
809 #if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII)
810 #define PyObject_ASCII(o) PyObject_Repr(o)
812 #if PY_MAJOR_VERSION >= 3
813 #define PyBaseString_Type PyUnicode_Type
814 #define PyStringObject PyUnicodeObject
815 #define PyString_Type PyUnicode_Type
816 #define PyString_Check PyUnicode_Check
817 #define PyString_CheckExact PyUnicode_CheckExact
818 #ifndef PyObject_Unicode
819 #define PyObject_Unicode PyObject_Str
822 #if PY_MAJOR_VERSION >= 3
823 #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj)
824 #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj)
826 #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj))
827 #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj))
829 #ifndef PySet_CheckExact
830 #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type)
832 #if PY_VERSION_HEX >= 0x030900A4
833 #define __Pyx_SET_REFCNT(obj, refcnt) Py_SET_REFCNT(obj, refcnt)
834 #define __Pyx_SET_SIZE(obj, size) Py_SET_SIZE(obj, size)
836 #define __Pyx_SET_REFCNT(obj, refcnt) Py_REFCNT(obj) = (refcnt)
837 #define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size)
839 #if CYTHON_ASSUME_SAFE_MACROS
840 #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq)
842 #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq)
844 #if PY_MAJOR_VERSION >= 3
845 #define PyIntObject PyLongObject
846 #define PyInt_Type PyLong_Type
847 #define PyInt_Check(op) PyLong_Check(op)
848 #define PyInt_CheckExact(op) PyLong_CheckExact(op)
849 #define PyInt_FromString PyLong_FromString
850 #define PyInt_FromUnicode PyLong_FromUnicode
851 #define PyInt_FromLong PyLong_FromLong
852 #define PyInt_FromSize_t PyLong_FromSize_t
853 #define PyInt_FromSsize_t PyLong_FromSsize_t
854 #define PyInt_AsLong PyLong_AsLong
855 #define PyInt_AS_LONG PyLong_AS_LONG
856 #define PyInt_AsSsize_t PyLong_AsSsize_t
857 #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask
858 #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
859 #define PyNumber_Int PyNumber_Long
861 #if PY_MAJOR_VERSION >= 3
862 #define PyBoolObject PyLongObject
864 #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY
865 #ifndef PyUnicode_InternFromString
866 #define PyUnicode_InternFromString(s) PyUnicode_FromString(s)
869 #if PY_VERSION_HEX < 0x030200A4
870 typedef long Py_hash_t;
871 #define __Pyx_PyInt_FromHash_t PyInt_FromLong
872 #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsHash_t
874 #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t
875 #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsSsize_t
877 #if PY_MAJOR_VERSION >= 3
878 #define __Pyx_PyMethod_New(func, self, klass) ((self) ? ((void)(klass), PyMethod_New(func, self)) : __Pyx_NewRef(func))
880 #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass)
882 #if CYTHON_USE_ASYNC_SLOTS
883 #if PY_VERSION_HEX >= 0x030500B1
884 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods
885 #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async)
887 #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved))
890 #define __Pyx_PyType_AsAsync(obj) NULL
892 #ifndef __Pyx_PyAsyncMethodsStruct
897 } __Pyx_PyAsyncMethodsStruct;
900 #if defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS)
901 #if !defined(_USE_MATH_DEFINES)
902 #define _USE_MATH_DEFINES
907 #define __PYX_NAN() ((float) NAN)
909 static CYTHON_INLINE
float __PYX_NAN() {
911 memset(&value, 0xFF,
sizeof(value));
915 #if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL)
916 #define __Pyx_truncl trunc
918 #define __Pyx_truncl truncl
921 #define __PYX_MARK_ERR_POS(f_index, lineno) \
922 { __pyx_filename = __pyx_f[f_index]; (void)__pyx_filename; __pyx_lineno = lineno; (void)__pyx_lineno; __pyx_clineno = __LINE__; (void)__pyx_clineno; }
923 #define __PYX_ERR(f_index, lineno, Ln_error) \
924 { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; }
926 #ifndef __PYX_EXTERN_C
928 #define __PYX_EXTERN_C extern "C"
930 #define __PYX_EXTERN_C extern
934 #define __PYX_HAVE__imate__traceinv___hutchinson_method
935 #define __PYX_HAVE_API__imate__traceinv___hutchinson_method
939 #include "pythread.h"
948 #if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS)
949 #define CYTHON_WITHOUT_ASSERTIONS
952 typedef struct {PyObject **p;
const char *s;
const Py_ssize_t n;
const char* encoding;
953 const char is_unicode;
const char is_str;
const char intern; } __Pyx_StringTabEntry;
955 #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
956 #define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0
957 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8)
958 #define __PYX_DEFAULT_STRING_ENCODING ""
959 #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
960 #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
961 #define __Pyx_uchar_cast(c) ((unsigned char)c)
962 #define __Pyx_long_cast(x) ((long)x)
963 #define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\
964 (sizeof(type) < sizeof(Py_ssize_t)) ||\
965 (sizeof(type) > sizeof(Py_ssize_t) &&\
966 likely(v < (type)PY_SSIZE_T_MAX ||\
967 v == (type)PY_SSIZE_T_MAX) &&\
968 (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\
969 v == (type)PY_SSIZE_T_MIN))) ||\
970 (sizeof(type) == sizeof(Py_ssize_t) &&\
971 (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\
972 v == (type)PY_SSIZE_T_MAX))) )
973 static CYTHON_INLINE
int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) {
974 return (
size_t) i < (size_t) limit;
976 #if defined (__cplusplus) && __cplusplus >= 201103L
978 #define __Pyx_sst_abs(value) std::abs(value)
979 #elif SIZEOF_INT >= SIZEOF_SIZE_T
980 #define __Pyx_sst_abs(value) abs(value)
981 #elif SIZEOF_LONG >= SIZEOF_SIZE_T
982 #define __Pyx_sst_abs(value) labs(value)
983 #elif defined (_MSC_VER)
984 #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value))
985 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
986 #define __Pyx_sst_abs(value) llabs(value)
987 #elif defined (__GNUC__)
988 #define __Pyx_sst_abs(value) __builtin_llabs(value)
990 #define __Pyx_sst_abs(value) ((value<0) ? -value : value)
992 static CYTHON_INLINE
const char* __Pyx_PyObject_AsString(PyObject*);
993 static CYTHON_INLINE
const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
994 #define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s))
995 #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
996 #define __Pyx_PyBytes_FromString PyBytes_FromString
997 #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
998 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(
const char*);
999 #if PY_MAJOR_VERSION < 3
1000 #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString
1001 #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
1003 #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString
1004 #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
1006 #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s))
1007 #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s))
1008 #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s))
1009 #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s))
1010 #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s))
1011 #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s))
1012 #define __Pyx_PyObject_AsWritableString(s) ((char*) __Pyx_PyObject_AsString(s))
1013 #define __Pyx_PyObject_AsWritableSString(s) ((signed char*) __Pyx_PyObject_AsString(s))
1014 #define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s))
1015 #define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s))
1016 #define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s))
1017 #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s)
1018 #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s)
1019 #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s)
1020 #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s)
1021 #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
1022 static CYTHON_INLINE
size_t __Pyx_Py_UNICODE_strlen(
const Py_UNICODE *u) {
1023 const Py_UNICODE *u_end = u;
1025 return (
size_t)(u_end - u - 1);
1027 #define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u))
1028 #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode
1029 #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode
1030 #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj)
1031 #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None)
1032 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(
long b);
1033 static CYTHON_INLINE
int __Pyx_PyObject_IsTrue(PyObject*);
1034 static CYTHON_INLINE
int __Pyx_PyObject_IsTrueAndDecref(PyObject*);
1035 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x);
1036 #define __Pyx_PySequence_Tuple(obj)\
1037 (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj))
1038 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
1039 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(
size_t);
1040 static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*);
1041 #if CYTHON_ASSUME_SAFE_MACROS
1042 #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
1044 #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
1046 #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x))
1047 #if PY_MAJOR_VERSION >= 3
1048 #define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x))
1050 #define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x))
1052 #define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(x))
1053 #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
1054 static int __Pyx_sys_getdefaultencoding_not_ascii;
1055 static int __Pyx_init_sys_getdefaultencoding_params(
void) {
1057 PyObject* default_encoding = NULL;
1058 PyObject* ascii_chars_u = NULL;
1059 PyObject* ascii_chars_b = NULL;
1060 const char* default_encoding_c;
1061 sys = PyImport_ImportModule(
"sys");
1063 default_encoding = PyObject_CallMethod(sys, (
char*)
"getdefaultencoding", NULL);
1065 if (!default_encoding)
goto bad;
1066 default_encoding_c = PyBytes_AsString(default_encoding);
1067 if (!default_encoding_c)
goto bad;
1068 if (strcmp(default_encoding_c,
"ascii") == 0) {
1069 __Pyx_sys_getdefaultencoding_not_ascii = 0;
1071 char ascii_chars[128];
1073 for (c = 0; c < 128; c++) {
1076 __Pyx_sys_getdefaultencoding_not_ascii = 1;
1077 ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL);
1078 if (!ascii_chars_u)
goto bad;
1079 ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL);
1080 if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) {
1083 "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.",
1084 default_encoding_c);
1087 Py_DECREF(ascii_chars_u);
1088 Py_DECREF(ascii_chars_b);
1090 Py_DECREF(default_encoding);
1093 Py_XDECREF(default_encoding);
1094 Py_XDECREF(ascii_chars_u);
1095 Py_XDECREF(ascii_chars_b);
1099 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3
1100 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)
1102 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
1103 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
1104 static char* __PYX_DEFAULT_STRING_ENCODING;
1105 static int __Pyx_init_sys_getdefaultencoding_params(
void) {
1107 PyObject* default_encoding = NULL;
1108 char* default_encoding_c;
1109 sys = PyImport_ImportModule(
"sys");
1111 default_encoding = PyObject_CallMethod(sys, (
char*) (
const char*)
"getdefaultencoding", NULL);
1113 if (!default_encoding)
goto bad;
1114 default_encoding_c = PyBytes_AsString(default_encoding);
1115 if (!default_encoding_c)
goto bad;
1116 __PYX_DEFAULT_STRING_ENCODING = (
char*) malloc(strlen(default_encoding_c) + 1);
1117 if (!__PYX_DEFAULT_STRING_ENCODING)
goto bad;
1118 strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c);
1119 Py_DECREF(default_encoding);
1122 Py_XDECREF(default_encoding);
1130 #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))
1131 #define likely(x) __builtin_expect(!!(x), 1)
1132 #define unlikely(x) __builtin_expect(!!(x), 0)
1134 #define likely(x) (x)
1135 #define unlikely(x) (x)
1137 static CYTHON_INLINE
void __Pyx_pretend_to_initialize(
void* ptr) { (void)ptr; }
1139 static PyObject *__pyx_m = NULL;
1140 static PyObject *__pyx_d;
1141 static PyObject *__pyx_b;
1142 static PyObject *__pyx_cython_runtime = NULL;
1143 static PyObject *__pyx_empty_tuple;
1144 static PyObject *__pyx_empty_bytes;
1145 static PyObject *__pyx_empty_unicode;
1146 static int __pyx_lineno;
1147 static int __pyx_clineno = 0;
1148 static const char * __pyx_cfilenm= __FILE__;
1149 static const char *__pyx_filename;
1152 static const char *__pyx_f[] = {
1153 "imate/traceinv/_hutchinson_method.pyx",
1157 struct __pyx_memoryview_obj;
1159 struct __pyx_memoryview_obj *memview;
1161 Py_ssize_t shape[8];
1162 Py_ssize_t strides[8];
1163 Py_ssize_t suboffsets[8];
1164 } __Pyx_memviewslice;
1165 #define __Pyx_MemoryView_Len(m) (m.shape[0])
1168 #include <pythread.h>
1169 #ifndef CYTHON_ATOMICS
1170 #define CYTHON_ATOMICS 1
1172 #define __PYX_CYTHON_ATOMICS_ENABLED() CYTHON_ATOMICS
1173 #define __pyx_atomic_int_type int
1174 #if CYTHON_ATOMICS && (__GNUC__ >= 5 || (__GNUC__ == 4 &&\
1175 (__GNUC_MINOR__ > 1 ||\
1176 (__GNUC_MINOR__ == 1 && __GNUC_PATCHLEVEL__ >= 2))))
1177 #define __pyx_atomic_incr_aligned(value) __sync_fetch_and_add(value, 1)
1178 #define __pyx_atomic_decr_aligned(value) __sync_fetch_and_sub(value, 1)
1179 #ifdef __PYX_DEBUG_ATOMICS
1180 #warning "Using GNU atomics"
1182 #elif CYTHON_ATOMICS && defined(_MSC_VER) && CYTHON_COMPILING_IN_NOGIL
1184 #undef __pyx_atomic_int_type
1185 #define __pyx_atomic_int_type long
1186 #pragma intrinsic (_InterlockedExchangeAdd)
1187 #define __pyx_atomic_incr_aligned(value) _InterlockedExchangeAdd(value, 1)
1188 #define __pyx_atomic_decr_aligned(value) _InterlockedExchangeAdd(value, -1)
1189 #ifdef __PYX_DEBUG_ATOMICS
1190 #pragma message ("Using MSVC atomics")
1193 #undef CYTHON_ATOMICS
1194 #define CYTHON_ATOMICS 0
1195 #ifdef __PYX_DEBUG_ATOMICS
1196 #warning "Not using atomics"
1199 typedef volatile __pyx_atomic_int_type __pyx_atomic_int;
1201 #define __pyx_add_acquisition_count(memview)\
1202 __pyx_atomic_incr_aligned(__pyx_get_slice_count_pointer(memview))
1203 #define __pyx_sub_acquisition_count(memview)\
1204 __pyx_atomic_decr_aligned(__pyx_get_slice_count_pointer(memview))
1206 #define __pyx_add_acquisition_count(memview)\
1207 __pyx_add_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock)
1208 #define __pyx_sub_acquisition_count(memview)\
1209 __pyx_sub_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock)
1213 #ifndef __PYX_FORCE_INIT_THREADS
1214 #define __PYX_FORCE_INIT_THREADS 0
1218 #define __Pyx_PyGILState_Ensure PyGILState_Ensure
1219 #define __Pyx_PyGILState_Release PyGILState_Release
1220 #define __Pyx_FastGIL_Remember()
1221 #define __Pyx_FastGIL_Forget()
1222 #define __Pyx_FastGilFuncInit()
1225 #define IS_UNSIGNED(type) (((type) -1) > 0)
1226 struct __Pyx_StructField_;
1227 #define __PYX_BUF_FLAGS_PACKED_STRUCT (1 << 0)
1230 struct __Pyx_StructField_* fields;
1232 size_t arraysize[8];
1238 typedef struct __Pyx_StructField_ {
1239 __Pyx_TypeInfo* type;
1242 } __Pyx_StructField;
1244 __Pyx_StructField* field;
1245 size_t parent_offset;
1246 } __Pyx_BufFmt_StackElem;
1248 __Pyx_StructField root;
1249 __Pyx_BufFmt_StackElem* head;
1251 size_t new_count, enc_count;
1252 size_t struct_alignment;
1257 char is_valid_array;
1258 } __Pyx_BufFmt_Context;
1268 typedef int __pyx_t_5imate_12_definitions_5types_LongIndexType;
1277 typedef int const __pyx_t_5imate_12_definitions_5types_ConstLongIndexType;
1286 typedef int __pyx_t_5imate_12_definitions_5types_IndexType;
1295 typedef int const __pyx_t_5imate_12_definitions_5types_ConstIndexType;
1304 typedef int __pyx_t_5imate_12_definitions_5types_FlagType;
1313 typedef int const __pyx_t_5imate_12_definitions_5types_ConstFlagType;
1316 struct __pyx_array_obj;
1317 struct __pyx_MemviewEnum_obj;
1318 struct __pyx_memoryview_obj;
1319 struct __pyx_memoryviewslice_obj;
1328 typedef __Pyx_memviewslice __pyx_t_5imate_12_definitions_5types_MemoryViewLongIndexType;
1337 typedef __Pyx_memviewslice __pyx_t_5imate_12_definitions_5types_MemoryViewIndexType;
1346 typedef __Pyx_memviewslice __pyx_t_5imate_12_definitions_5types_MemoryViewFlagType;
1355 typedef double (*__pyx_t_5imate_12_definitions_5types_kernel_type)(
double const ,
double const );
1364 struct __pyx_array_obj {
1366 struct __pyx_vtabstruct_array *__pyx_vtab;
1372 Py_ssize_t *_strides;
1373 Py_ssize_t itemsize;
1376 void (*callback_free_data)(
void *);
1378 int dtype_is_object;
1389 struct __pyx_MemviewEnum_obj {
1402 struct __pyx_memoryview_obj {
1404 struct __pyx_vtabstruct_memoryview *__pyx_vtab;
1407 PyObject *_array_interface;
1408 PyThread_type_lock lock;
1409 __pyx_atomic_int acquisition_count[2];
1410 __pyx_atomic_int *acquisition_count_aligned_p;
1413 int dtype_is_object;
1414 __Pyx_TypeInfo *typeinfo;
1425 struct __pyx_memoryviewslice_obj {
1426 struct __pyx_memoryview_obj __pyx_base;
1427 __Pyx_memviewslice from_slice;
1428 PyObject *from_object;
1429 PyObject *(*to_object_func)(
char *);
1430 int (*to_dtype_func)(
char *, PyObject *);
1443 struct __pyx_vtabstruct_array {
1444 PyObject *(*get_memview)(
struct __pyx_array_obj *);
1446 static struct __pyx_vtabstruct_array *__pyx_vtabptr_array;
1457 struct __pyx_vtabstruct_memoryview {
1458 char *(*get_item_pointer)(
struct __pyx_memoryview_obj *, PyObject *);
1459 PyObject *(*is_slice)(
struct __pyx_memoryview_obj *, PyObject *);
1460 PyObject *(*setitem_slice_assignment)(
struct __pyx_memoryview_obj *, PyObject *, PyObject *);
1461 PyObject *(*setitem_slice_assign_scalar)(
struct __pyx_memoryview_obj *,
struct __pyx_memoryview_obj *, PyObject *);
1462 PyObject *(*setitem_indexed)(
struct __pyx_memoryview_obj *, PyObject *, PyObject *);
1463 PyObject *(*convert_item_to_object)(
struct __pyx_memoryview_obj *,
char *);
1464 PyObject *(*assign_item_from_object)(
struct __pyx_memoryview_obj *,
char *, PyObject *);
1466 static struct __pyx_vtabstruct_memoryview *__pyx_vtabptr_memoryview;
1477 struct __pyx_vtabstruct__memoryviewslice {
1478 struct __pyx_vtabstruct_memoryview __pyx_base;
1480 static struct __pyx_vtabstruct__memoryviewslice *__pyx_vtabptr__memoryviewslice;
1484 #ifndef CYTHON_REFNANNY
1485 #define CYTHON_REFNANNY 0
1489 void (*INCREF)(
void*, PyObject*, int);
1490 void (*DECREF)(
void*, PyObject*, int);
1491 void (*GOTREF)(
void*, PyObject*, int);
1492 void (*GIVEREF)(
void*, PyObject*, int);
1493 void* (*SetupContext)(
const char*, int,
const char*);
1494 void (*FinishContext)(
void**);
1495 } __Pyx_RefNannyAPIStruct;
1496 static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
1497 static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(
const char *modname);
1498 #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
1500 #define __Pyx_RefNannySetupContext(name, acquire_gil)\
1502 PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
1503 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
1504 PyGILState_Release(__pyx_gilstate_save);\
1506 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
1509 #define __Pyx_RefNannySetupContext(name, acquire_gil)\
1510 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)
1512 #define __Pyx_RefNannyFinishContext()\
1513 __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
1514 #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1515 #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1516 #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1517 #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1518 #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0)
1519 #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0)
1520 #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0)
1521 #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0)
1523 #define __Pyx_RefNannyDeclarations
1524 #define __Pyx_RefNannySetupContext(name, acquire_gil)
1525 #define __Pyx_RefNannyFinishContext()
1526 #define __Pyx_INCREF(r) Py_INCREF(r)
1527 #define __Pyx_DECREF(r) Py_DECREF(r)
1528 #define __Pyx_GOTREF(r)
1529 #define __Pyx_GIVEREF(r)
1530 #define __Pyx_XINCREF(r) Py_XINCREF(r)
1531 #define __Pyx_XDECREF(r) Py_XDECREF(r)
1532 #define __Pyx_XGOTREF(r)
1533 #define __Pyx_XGIVEREF(r)
1535 #define __Pyx_XDECREF_SET(r, v) do {\
1536 PyObject *tmp = (PyObject *) r;\
1537 r = v; __Pyx_XDECREF(tmp);\
1539 #define __Pyx_DECREF_SET(r, v) do {\
1540 PyObject *tmp = (PyObject *) r;\
1541 r = v; __Pyx_DECREF(tmp);\
1543 #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0)
1544 #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0)
1547 #if CYTHON_USE_TYPE_SLOTS
1548 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name);
1550 #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
1554 static PyObject *__Pyx_GetBuiltinName(PyObject *name);
1557 static void __Pyx_RaiseDoubleKeywordsError(
const char* func_name, PyObject* kw_name);
1560 static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\
1561 PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\
1562 const char* function_name);
1565 static void __Pyx_RaiseArgtupleInvalid(
const char* func_name,
int exact,
1566 Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found);
1569 #if CYTHON_FAST_THREAD_STATE
1570 #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate;
1571 #define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current;
1572 #define __Pyx_PyErr_Occurred() __pyx_tstate->curexc_type
1574 #define __Pyx_PyThreadState_declare
1575 #define __Pyx_PyThreadState_assign
1576 #define __Pyx_PyErr_Occurred() PyErr_Occurred()
1580 #if CYTHON_FAST_THREAD_STATE
1581 #define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL)
1582 #define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb)
1583 #define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb)
1584 #define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb)
1585 #define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb)
1586 static CYTHON_INLINE
void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
1587 static CYTHON_INLINE
void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1588 #if CYTHON_COMPILING_IN_CPYTHON
1589 #define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL))
1591 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
1594 #define __Pyx_PyErr_Clear() PyErr_Clear()
1595 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
1596 #define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb)
1597 #define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb)
1598 #define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb)
1599 #define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb)
1600 #define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb)
1601 #define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb)
1605 #ifndef CYTHON_PROFILE
1606 #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_PYSTON
1607 #define CYTHON_PROFILE 0
1609 #define CYTHON_PROFILE 1
1612 #ifndef CYTHON_TRACE_NOGIL
1613 #define CYTHON_TRACE_NOGIL 0
1615 #if CYTHON_TRACE_NOGIL && !defined(CYTHON_TRACE)
1616 #define CYTHON_TRACE 1
1619 #ifndef CYTHON_TRACE
1620 #define CYTHON_TRACE 0
1623 #undef CYTHON_PROFILE_REUSE_FRAME
1625 #ifndef CYTHON_PROFILE_REUSE_FRAME
1626 #define CYTHON_PROFILE_REUSE_FRAME 0
1628 #if CYTHON_PROFILE || CYTHON_TRACE
1629 #include "compile.h"
1630 #include "frameobject.h"
1631 #include "traceback.h"
1632 #if PY_VERSION_HEX >= 0x030b00a6
1633 #ifndef Py_BUILD_CORE
1634 #define Py_BUILD_CORE 1
1636 #include "internal/pycore_frame.h"
1638 #if CYTHON_PROFILE_REUSE_FRAME
1639 #define CYTHON_FRAME_MODIFIER static
1640 #define CYTHON_FRAME_DEL(frame)
1642 #define CYTHON_FRAME_MODIFIER
1643 #define CYTHON_FRAME_DEL(frame) Py_CLEAR(frame)
1645 #define __Pyx_TraceDeclarations\
1646 static PyCodeObject *__pyx_frame_code = NULL;\
1647 CYTHON_FRAME_MODIFIER PyFrameObject *__pyx_frame = NULL;\
1648 int __Pyx_use_tracing = 0;
1649 #define __Pyx_TraceFrameInit(codeobj)\
1650 if (codeobj) __pyx_frame_code = (PyCodeObject*) codeobj;
1651 #if PY_VERSION_HEX >= 0x030b00a2
1652 #define __Pyx_IsTracing(tstate, check_tracing, check_funcs)\
1653 (unlikely((tstate)->cframe->use_tracing) &&\
1654 (!(check_tracing) || !(tstate)->tracing) &&\
1655 (!(check_funcs) || (tstate)->c_profilefunc || (CYTHON_TRACE && (tstate)->c_tracefunc)))
1656 #define __Pyx_EnterTracing(tstate) PyThreadState_EnterTracing(tstate)
1657 #define __Pyx_LeaveTracing(tstate) PyThreadState_LeaveTracing(tstate)
1658 #elif PY_VERSION_HEX >= 0x030a00b1
1659 #define __Pyx_IsTracing(tstate, check_tracing, check_funcs)\
1660 (unlikely((tstate)->cframe->use_tracing) &&\
1661 (!(check_tracing) || !(tstate)->tracing) &&\
1662 (!(check_funcs) || (tstate)->c_profilefunc || (CYTHON_TRACE && (tstate)->c_tracefunc)))
1663 #define __Pyx_EnterTracing(tstate)\
1664 do { tstate->tracing++; tstate->cframe->use_tracing = 0; } while (0)
1665 #define __Pyx_LeaveTracing(tstate)\
1668 tstate->cframe->use_tracing = ((CYTHON_TRACE && tstate->c_tracefunc != NULL)\
1669 || tstate->c_profilefunc != NULL);\
1672 #define __Pyx_IsTracing(tstate, check_tracing, check_funcs)\
1673 (unlikely((tstate)->use_tracing) &&\
1674 (!(check_tracing) || !(tstate)->tracing) &&\
1675 (!(check_funcs) || (tstate)->c_profilefunc || (CYTHON_TRACE && (tstate)->c_tracefunc)))
1676 #define __Pyx_EnterTracing(tstate)\
1677 do { tstate->tracing++; tstate->use_tracing = 0; } while (0)
1678 #define __Pyx_LeaveTracing(tstate)\
1681 tstate->use_tracing = ((CYTHON_TRACE && tstate->c_tracefunc != NULL)\
1682 || tstate->c_profilefunc != NULL);\
1686 #define __Pyx_TraceCall(funcname, srcfile, firstlineno, nogil, goto_error)\
1688 if (CYTHON_TRACE_NOGIL) {\
1689 PyThreadState *tstate;\
1690 PyGILState_STATE state = PyGILState_Ensure();\
1691 tstate = __Pyx_PyThreadState_Current;\
1692 if (__Pyx_IsTracing(tstate, 1, 1)) {\
1693 __Pyx_use_tracing = __Pyx_TraceSetupAndCall(&__pyx_frame_code, &__pyx_frame, tstate, funcname, srcfile, firstlineno);\
1695 PyGILState_Release(state);\
1696 if (unlikely(__Pyx_use_tracing < 0)) goto_error;\
1699 PyThreadState* tstate = PyThreadState_GET();\
1700 if (__Pyx_IsTracing(tstate, 1, 1)) {\
1701 __Pyx_use_tracing = __Pyx_TraceSetupAndCall(&__pyx_frame_code, &__pyx_frame, tstate, funcname, srcfile, firstlineno);\
1702 if (unlikely(__Pyx_use_tracing < 0)) goto_error;\
1706 #define __Pyx_TraceCall(funcname, srcfile, firstlineno, nogil, goto_error)\
1707 { PyThreadState* tstate = PyThreadState_GET();\
1708 if (__Pyx_IsTracing(tstate, 1, 1)) {\
1709 __Pyx_use_tracing = __Pyx_TraceSetupAndCall(&__pyx_frame_code, &__pyx_frame, tstate, funcname, srcfile, firstlineno);\
1710 if (unlikely(__Pyx_use_tracing < 0)) goto_error;\
1714 #define __Pyx_TraceException()\
1715 if (likely(!__Pyx_use_tracing)); else {\
1716 PyThreadState* tstate = __Pyx_PyThreadState_Current;\
1717 if (__Pyx_IsTracing(tstate, 0, 1)) {\
1718 __Pyx_EnterTracing(tstate);\
1719 PyObject *exc_info = __Pyx_GetExceptionTuple(tstate);\
1721 if (CYTHON_TRACE && tstate->c_tracefunc)\
1722 tstate->c_tracefunc(\
1723 tstate->c_traceobj, __pyx_frame, PyTrace_EXCEPTION, exc_info);\
1724 tstate->c_profilefunc(\
1725 tstate->c_profileobj, __pyx_frame, PyTrace_EXCEPTION, exc_info);\
1726 Py_DECREF(exc_info);\
1728 __Pyx_LeaveTracing(tstate);\
1731 static void __Pyx_call_return_trace_func(PyThreadState *tstate, PyFrameObject *frame, PyObject *result) {
1732 PyObject *type, *value, *traceback;
1733 __Pyx_ErrFetchInState(tstate, &type, &value, &traceback);
1734 __Pyx_EnterTracing(tstate);
1735 if (CYTHON_TRACE && tstate->c_tracefunc)
1736 tstate->c_tracefunc(tstate->c_traceobj, frame, PyTrace_RETURN, result);
1737 if (tstate->c_profilefunc)
1738 tstate->c_profilefunc(tstate->c_profileobj, frame, PyTrace_RETURN, result);
1739 CYTHON_FRAME_DEL(frame);
1740 __Pyx_LeaveTracing(tstate);
1741 __Pyx_ErrRestoreInState(tstate, type, value, traceback);
1744 #define __Pyx_TraceReturn(result, nogil)\
1745 if (likely(!__Pyx_use_tracing)); else {\
1747 if (CYTHON_TRACE_NOGIL) {\
1748 PyThreadState *tstate;\
1749 PyGILState_STATE state = PyGILState_Ensure();\
1750 tstate = __Pyx_PyThreadState_Current;\
1751 if (__Pyx_IsTracing(tstate, 0, 0)) {\
1752 __Pyx_call_return_trace_func(tstate, __pyx_frame, (PyObject*)result);\
1754 PyGILState_Release(state);\
1757 PyThreadState* tstate = __Pyx_PyThreadState_Current;\
1758 if (__Pyx_IsTracing(tstate, 0, 0)) {\
1759 __Pyx_call_return_trace_func(tstate, __pyx_frame, (PyObject*)result);\
1764 #define __Pyx_TraceReturn(result, nogil)\
1765 if (likely(!__Pyx_use_tracing)); else {\
1766 PyThreadState* tstate = __Pyx_PyThreadState_Current;\
1767 if (__Pyx_IsTracing(tstate, 0, 0)) {\
1768 __Pyx_call_return_trace_func(tstate, __pyx_frame, (PyObject*)result);\
1772 static PyCodeObject *__Pyx_createFrameCodeObject(
const char *funcname,
const char *srcfile,
int firstlineno);
1773 static int __Pyx_TraceSetupAndCall(PyCodeObject** code, PyFrameObject** frame, PyThreadState* tstate,
const char *funcname,
const char *srcfile,
int firstlineno);
1775 #define __Pyx_TraceDeclarations
1776 #define __Pyx_TraceFrameInit(codeobj)
1777 #define __Pyx_TraceCall(funcname, srcfile, firstlineno, nogil, goto_error) if ((1)); else goto_error;
1778 #define __Pyx_TraceException()
1779 #define __Pyx_TraceReturn(result, nogil)
1782 static int __Pyx_call_line_trace_func(PyThreadState *tstate, PyFrameObject *frame,
int lineno) {
1784 PyObject *type, *value, *traceback;
1785 __Pyx_ErrFetchInState(tstate, &type, &value, &traceback);
1786 __Pyx_PyFrame_SetLineNumber(frame, lineno);
1787 __Pyx_EnterTracing(tstate);
1788 ret = tstate->c_tracefunc(tstate->c_traceobj, frame, PyTrace_LINE, NULL);
1789 __Pyx_LeaveTracing(tstate);
1791 __Pyx_ErrRestoreInState(tstate, type, value, traceback);
1795 Py_XDECREF(traceback);
1800 #define __Pyx_TraceLine(lineno, nogil, goto_error)\
1801 if (likely(!__Pyx_use_tracing)); else {\
1803 if (CYTHON_TRACE_NOGIL) {\
1805 PyThreadState *tstate;\
1806 PyGILState_STATE state = PyGILState_Ensure();\
1807 tstate = __Pyx_PyThreadState_Current;\
1808 if (__Pyx_IsTracing(tstate, 0, 0) && tstate->c_tracefunc && __pyx_frame->f_trace) {\
1809 ret = __Pyx_call_line_trace_func(tstate, __pyx_frame, lineno);\
1811 PyGILState_Release(state);\
1812 if (unlikely(ret)) goto_error;\
1815 PyThreadState* tstate = __Pyx_PyThreadState_Current;\
1816 if (__Pyx_IsTracing(tstate, 0, 0) && tstate->c_tracefunc && __pyx_frame->f_trace) {\
1817 int ret = __Pyx_call_line_trace_func(tstate, __pyx_frame, lineno);\
1818 if (unlikely(ret)) goto_error;\
1823 #define __Pyx_TraceLine(lineno, nogil, goto_error)\
1824 if (likely(!__Pyx_use_tracing)); else {\
1825 PyThreadState* tstate = __Pyx_PyThreadState_Current;\
1826 if (__Pyx_IsTracing(tstate, 0, 0) && tstate->c_tracefunc && __pyx_frame->f_trace) {\
1827 int ret = __Pyx_call_line_trace_func(tstate, __pyx_frame, lineno);\
1828 if (unlikely(ret)) goto_error;\
1833 #define __Pyx_TraceLine(lineno, nogil, goto_error) if ((1)); else goto_error;
1837 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
1838 #define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1)
1839 #define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag)
1840 #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\
1841 (version_var) = __PYX_GET_DICT_VERSION(dict);\
1842 (cache_var) = (value);
1843 #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\
1844 static PY_UINT64_T __pyx_dict_version = 0;\
1845 static PyObject *__pyx_dict_cached_value = NULL;\
1846 if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\
1847 (VAR) = __pyx_dict_cached_value;\
1849 (VAR) = __pyx_dict_cached_value = (LOOKUP);\
1850 __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\
1853 static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj);
1854 static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj);
1855 static CYTHON_INLINE
int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version);
1857 #define __PYX_GET_DICT_VERSION(dict) (0)
1858 #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)
1859 #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP);
1863 #if CYTHON_USE_DICT_VERSIONS
1864 #define __Pyx_GetModuleGlobalName(var, name) do {\
1865 static PY_UINT64_T __pyx_dict_version = 0;\
1866 static PyObject *__pyx_dict_cached_value = NULL;\
1867 (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\
1868 (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\
1869 __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
1871 #define __Pyx_GetModuleGlobalNameUncached(var, name) do {\
1872 PY_UINT64_T __pyx_dict_version;\
1873 PyObject *__pyx_dict_cached_value;\
1874 (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
1876 static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value);
1878 #define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name)
1879 #define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name)
1880 static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name);
1884 #if CYTHON_FAST_PYCALL
1885 #define __Pyx_PyFunction_FastCall(func, args, nargs)\
1886 __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL)
1887 #if 1 || PY_VERSION_HEX < 0x030600B1
1888 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs);
1890 #define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs)
1892 #define __Pyx_BUILD_ASSERT_EXPR(cond)\
1893 (sizeof(char [1 - 2*!(cond)]) - 1)
1894 #ifndef Py_MEMBER_SIZE
1895 #define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member)
1897 #if CYTHON_FAST_PYCALL
1898 static size_t __pyx_pyframe_localsplus_offset = 0;
1899 #include "frameobject.h"
1900 #if PY_VERSION_HEX >= 0x030b00a6
1901 #ifndef Py_BUILD_CORE
1902 #define Py_BUILD_CORE 1
1904 #include "internal/pycore_frame.h"
1906 #define __Pxy_PyFrame_Initialize_Offsets()\
1907 ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\
1908 (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus)))
1909 #define __Pyx_PyFrame_GetLocalsplus(frame)\
1910 (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset))
1915 #if CYTHON_FAST_PYCCALL
1916 static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs);
1918 #define __Pyx_PyCFunction_FastCall(func, args, nargs) (assert(0), NULL)
1922 #if CYTHON_COMPILING_IN_CPYTHON
1923 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
1925 #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
1929 static CYTHON_INLINE
void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);
1932 static CYTHON_INLINE
void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);
1935 static CYTHON_INLINE
int __Pyx_IterFinish(
void);
1938 static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected);
1941 #define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1942 (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1943 __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\
1944 (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\
1945 __Pyx_GetItemInt_Generic(o, to_py_func(i))))
1946 #define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1947 (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1948 __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
1949 (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL))
1950 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
1951 int wraparound,
int boundscheck);
1952 #define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1953 (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1954 __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
1955 (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL))
1956 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
1957 int wraparound,
int boundscheck);
1958 static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j);
1959 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
1960 int is_list,
int wraparound,
int boundscheck);
1963 #if CYTHON_COMPILING_IN_CPYTHON
1964 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
1968 #if CYTHON_COMPILING_IN_CPYTHON
1969 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func);
1971 #define __Pyx_PyObject_CallNoArg(func) __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL)
1975 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);
1978 static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject*
function, PyObject* arg1, PyObject* arg2);
1984 static CYTHON_INLINE
int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2,
int equals);
1987 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);
1990 #define __Pyx_PyObject_DelSlice(obj, cstart, cstop, py_start, py_stop, py_slice, has_cstart, has_cstop, wraparound)\
1991 __Pyx_PyObject_SetSlice(obj, (PyObject*)NULL, cstart, cstop, py_start, py_stop, py_slice, has_cstart, has_cstop, wraparound)
1992 static CYTHON_INLINE
int __Pyx_PyObject_SetSlice(
1993 PyObject* obj, PyObject* value, Py_ssize_t cstart, Py_ssize_t cstop,
1994 PyObject** py_start, PyObject** py_stop, PyObject** py_slice,
1995 int has_cstart,
int has_cstop,
int wraparound);
1998 static CYTHON_INLINE PyObject* __Pyx_PyInt_EqObjC(PyObject *op1, PyObject *op2,
long intval,
long inplace);
2001 #if PY_VERSION_HEX >= 0x03050000
2002 #define __Pyx_PyNumber_MatrixMultiply(x,y) PyNumber_MatrixMultiply(x,y)
2003 #define __Pyx_PyNumber_InPlaceMatrixMultiply(x,y) PyNumber_InPlaceMatrixMultiply(x,y)
2005 #define __Pyx_PyNumber_MatrixMultiply(x,y) __Pyx__PyNumber_MatrixMultiply(x, y, "@")
2006 static PyObject* __Pyx__PyNumber_MatrixMultiply(PyObject* x, PyObject* y,
const char* op_name);
2007 static PyObject* __Pyx_PyNumber_InPlaceMatrixMultiply(PyObject* x, PyObject* y);
2011 #if CYTHON_USE_TYPE_SLOTS
2012 static CYTHON_INLINE PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key);
2014 #define __Pyx_PyObject_GetItem(obj, key) PyObject_GetItem(obj, key)
2018 #define __Pyx_SetItemInt(o, i, v, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
2019 (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
2020 __Pyx_SetItemInt_Fast(o, (Py_ssize_t)i, v, is_list, wraparound, boundscheck) :\
2021 (is_list ? (PyErr_SetString(PyExc_IndexError, "list assignment index out of range"), -1) :\
2022 __Pyx_SetItemInt_Generic(o, to_py_func(i), v)))
2023 static int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *v);
2024 static CYTHON_INLINE
int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObject *v,
2025 int is_list,
int wraparound,
int boundscheck);
2028 #define __Pyx_BUF_MAX_NDIMS %(BUF_MAX_NDIMS)d
2029 #define __Pyx_MEMVIEW_DIRECT 1
2030 #define __Pyx_MEMVIEW_PTR 2
2031 #define __Pyx_MEMVIEW_FULL 4
2032 #define __Pyx_MEMVIEW_CONTIG 8
2033 #define __Pyx_MEMVIEW_STRIDED 16
2034 #define __Pyx_MEMVIEW_FOLLOW 32
2035 #define __Pyx_IS_C_CONTIG 1
2036 #define __Pyx_IS_F_CONTIG 2
2037 static int __Pyx_init_memviewslice(
2038 struct __pyx_memoryview_obj *memview,
2040 __Pyx_memviewslice *memviewslice,
2041 int memview_is_new_reference);
2042 static CYTHON_INLINE
int __pyx_add_acquisition_count_locked(
2043 __pyx_atomic_int *acquisition_count, PyThread_type_lock lock);
2044 static CYTHON_INLINE
int __pyx_sub_acquisition_count_locked(
2045 __pyx_atomic_int *acquisition_count, PyThread_type_lock lock);
2046 #define __pyx_get_slice_count_pointer(memview) (memview->acquisition_count_aligned_p)
2047 #define __pyx_get_slice_count(memview) (*__pyx_get_slice_count_pointer(memview))
2048 #define __PYX_INC_MEMVIEW(slice, have_gil) __Pyx_INC_MEMVIEW(slice, have_gil, __LINE__)
2049 #define __PYX_XDEC_MEMVIEW(slice, have_gil) __Pyx_XDEC_MEMVIEW(slice, have_gil, __LINE__)
2050 static CYTHON_INLINE
void __Pyx_INC_MEMVIEW(__Pyx_memviewslice *,
int,
int);
2051 static CYTHON_INLINE
void __Pyx_XDEC_MEMVIEW(__Pyx_memviewslice *,
int,
int);
2054 static CYTHON_INLINE
void __Pyx_RaiseUnboundLocalError(
const char *varname);
2057 #define __Pyx_ArgTypeTest(obj, type, none_allowed, name, exact)\
2058 ((likely((Py_TYPE(obj) == type) | (none_allowed && (obj == Py_None)))) ? 1 :\
2059 __Pyx__ArgTypeTest(obj, type, name, exact))
2060 static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type,
const char *name,
int exact);
2063 static CYTHON_INLINE
int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2,
int equals);
2066 #if PY_MAJOR_VERSION >= 3
2067 #define __Pyx_PyString_Equals __Pyx_PyUnicode_Equals
2069 #define __Pyx_PyString_Equals __Pyx_PyBytes_Equals
2073 #define UNARY_NEG_WOULD_OVERFLOW(x)\
2074 (((x) < 0) & ((unsigned long)(x) == 0-(unsigned long)(x)))
2076 static CYTHON_UNUSED
int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags);
2078 static void __Pyx_WriteUnraisable(
const char *name,
int clineno,
2079 int lineno,
const char *filename,
2080 int full_traceback,
int nogil);
2082 static PyObject *__pyx_array_get_memview(
struct __pyx_array_obj *);
2084 static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *);
2087 static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16(
const char *s, Py_ssize_t size,
const char *errors) {
2089 return PyUnicode_DecodeUTF16(s, size, errors, &byteorder);
2091 static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16LE(
const char *s, Py_ssize_t size,
const char *errors) {
2093 return PyUnicode_DecodeUTF16(s, size, errors, &byteorder);
2095 static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16BE(
const char *s, Py_ssize_t size,
const char *errors) {
2097 return PyUnicode_DecodeUTF16(s, size, errors, &byteorder);
2101 static CYTHON_INLINE PyObject* __Pyx_decode_c_string(
2102 const char* cstring, Py_ssize_t start, Py_ssize_t stop,
2103 const char* encoding,
const char* errors,
2104 PyObject* (*decode_func)(
const char *s, Py_ssize_t size,
const char *errors));
2107 #if CYTHON_FAST_THREAD_STATE
2108 #define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err)
2109 static CYTHON_INLINE
int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err);
2111 #define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err)
2115 static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *, PyObject *, PyObject *);
2118 static CYTHON_INLINE
void __Pyx_RaiseNoneNotIterableError(
void);
2121 static CYTHON_INLINE
int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type);
2124 #if CYTHON_USE_EXC_INFO_STACK
2125 static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate);
2129 #if CYTHON_FAST_THREAD_STATE
2130 #define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb)
2131 static CYTHON_INLINE
void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
2132 #define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb)
2133 static CYTHON_INLINE
void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
2135 #define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb)
2136 #define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb)
2140 #if CYTHON_FAST_THREAD_STATE
2141 #define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb)
2142 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
2144 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb);
2148 #if CYTHON_FAST_THREAD_STATE
2149 #define __Pyx_ExceptionSwap(type, value, tb) __Pyx__ExceptionSwap(__pyx_tstate, type, value, tb)
2150 static CYTHON_INLINE
void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
2152 static CYTHON_INLINE
void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb);
2156 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list,
int level);
2159 #if CYTHON_COMPILING_IN_CPYTHON
2160 #define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type)
2161 static CYTHON_INLINE
int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b);
2162 static CYTHON_INLINE
int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type);
2163 static CYTHON_INLINE
int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2);
2165 #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
2166 #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type)
2167 #define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2))
2169 #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
2171 static CYTHON_UNUSED
int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags);
2173 #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
2174 static CYTHON_INLINE
int __Pyx_ListComp_Append(PyObject* list, PyObject* x) {
2175 PyListObject* L = (PyListObject*) list;
2176 Py_ssize_t len = Py_SIZE(list);
2177 if (likely(L->allocated > len)) {
2179 PyList_SET_ITEM(list, len, x);
2180 __Pyx_SET_SIZE(list, len + 1);
2183 return PyList_Append(list, x);
2186 #define __Pyx_ListComp_Append(L,x) PyList_Append(L,x)
2190 #if !CYTHON_COMPILING_IN_PYPY
2191 static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2,
long intval,
int inplace,
int zerodivision_check);
2193 #define __Pyx_PyInt_AddObjC(op1, op2, intval, inplace, zerodivision_check)\
2194 (inplace ? PyNumber_InPlaceAdd(op1, op2) : PyNumber_Add(op1, op2))
2198 static CYTHON_INLINE
int __Pyx_PyList_Extend(PyObject* L, PyObject* v) {
2199 #if CYTHON_COMPILING_IN_CPYTHON
2200 PyObject* none = _PyList_Extend((PyListObject*)L, v);
2201 if (unlikely(!none))
2206 return PyList_SetSlice(L, PY_SSIZE_T_MAX, PY_SSIZE_T_MAX, v);
2211 #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
2212 static CYTHON_INLINE
int __Pyx_PyList_Append(PyObject* list, PyObject* x) {
2213 PyListObject* L = (PyListObject*) list;
2214 Py_ssize_t len = Py_SIZE(list);
2215 if (likely(L->allocated > len) & likely(len > (L->allocated >> 1))) {
2217 PyList_SET_ITEM(list, len, x);
2218 __Pyx_SET_SIZE(list, len + 1);
2221 return PyList_Append(list, x);
2224 #define __Pyx_PyList_Append(L,x) PyList_Append(L,x)
2228 #define __Pyx_init_assertions_enabled()
2229 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag)
2230 #define __pyx_assertions_enabled() (1)
2231 #elif PY_VERSION_HEX < 0x03080000 || CYTHON_COMPILING_IN_PYPY || defined(Py_LIMITED_API)
2232 #define __pyx_assertions_enabled() (!Py_OptimizeFlag)
2233 #elif CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030900A6
2234 static int __pyx_assertions_enabled_flag;
2235 #define __pyx_assertions_enabled() (__pyx_assertions_enabled_flag)
2236 #undef __Pyx_init_assertions_enabled
2237 static void __Pyx_init_assertions_enabled(
void) {
2238 __pyx_assertions_enabled_flag = ! _PyInterpreterState_GetConfig(__Pyx_PyThreadState_Current->interp)->optimization_level;
2241 #define __pyx_assertions_enabled() (!Py_OptimizeFlag)
2245 static CYTHON_INLINE
int __Pyx_PySequence_ContainsTF(PyObject* item, PyObject* seq,
int eq) {
2246 int result = PySequence_Contains(seq, item);
2247 return unlikely(result < 0) ? result : (result == (eq == Py_EQ));
2251 static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name);
2254 static CYTHON_INLINE
int __Pyx_HasAttr(PyObject *, PyObject *);
2257 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
2258 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name);
2260 #define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr
2264 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
2265 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name);
2267 #define __Pyx_PyObject_GenericGetAttr PyObject_GenericGetAttr
2271 static int __Pyx_SetVtable(PyObject *dict,
void *vtable);
2274 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name);
2277 static int __Pyx_setup_reduce(PyObject* type_obj);
2280 static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type);
2283 #define __Pyx_CyFunction_USED 1
2284 #define __Pyx_CYFUNCTION_STATICMETHOD 0x01
2285 #define __Pyx_CYFUNCTION_CLASSMETHOD 0x02
2286 #define __Pyx_CYFUNCTION_CCLASS 0x04
2287 #define __Pyx_CyFunction_GetClosure(f)\
2288 (((__pyx_CyFunctionObject *) (f))->func_closure)
2289 #define __Pyx_CyFunction_GetClassObj(f)\
2290 (((__pyx_CyFunctionObject *) (f))->func_classobj)
2291 #define __Pyx_CyFunction_Defaults(type, f)\
2292 ((type *)(((__pyx_CyFunctionObject *) (f))->defaults))
2293 #define __Pyx_CyFunction_SetDefaultsGetter(f, g)\
2294 ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g)
2296 PyCFunctionObject func;
2297 #if PY_VERSION_HEX < 0x030500A0
2298 PyObject *func_weakreflist;
2300 PyObject *func_dict;
2301 PyObject *func_name;
2302 PyObject *func_qualname;
2304 PyObject *func_globals;
2305 PyObject *func_code;
2306 PyObject *func_closure;
2307 PyObject *func_classobj;
2309 int defaults_pyobjects;
2310 size_t defaults_size;
2312 PyObject *defaults_tuple;
2313 PyObject *defaults_kwdict;
2314 PyObject *(*defaults_getter)(PyObject *);
2315 PyObject *func_annotations;
2316 } __pyx_CyFunctionObject;
2317 static PyTypeObject *__pyx_CyFunctionType = 0;
2318 #define __Pyx_CyFunction_Check(obj) (__Pyx_TypeCheck(obj, __pyx_CyFunctionType))
2319 static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject* op, PyMethodDef *ml,
2320 int flags, PyObject* qualname,
2322 PyObject *module, PyObject *globals,
2324 static CYTHON_INLINE
void *__Pyx_CyFunction_InitDefaults(PyObject *m,
2327 static CYTHON_INLINE
void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m,
2329 static CYTHON_INLINE
void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m,
2331 static CYTHON_INLINE
void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m,
2333 static int __pyx_CyFunction_init(
void);
2336 static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml,
2337 int flags, PyObject* qualname,
2339 PyObject *module, PyObject *globals,
2343 #ifdef CYTHON_CLINE_IN_TRACEBACK
2344 #define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0)
2346 static int __Pyx_CLineForTraceback(PyThreadState *tstate,
int c_line);
2351 PyCodeObject* code_object;
2353 } __Pyx_CodeObjectCacheEntry;
2354 struct __Pyx_CodeObjectCache {
2357 __Pyx_CodeObjectCacheEntry* entries;
2359 static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL};
2360 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries,
int count,
int code_line);
2361 static PyCodeObject *__pyx_find_code_object(
int code_line);
2362 static void __pyx_insert_code_object(
int code_line, PyCodeObject* code_object);
2365 static void __Pyx_AddTraceback(
const char *funcname,
int c_line,
2366 int py_line,
const char *filename);
2368 #if PY_MAJOR_VERSION < 3
2369 static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view,
int flags);
2370 static void __Pyx_ReleaseBuffer(Py_buffer *view);
2372 #define __Pyx_GetBuffer PyObject_GetBuffer
2373 #define __Pyx_ReleaseBuffer PyBuffer_Release
2379 Py_ssize_t shape, strides, suboffsets;
2380 } __Pyx_Buf_DimInfo;
2386 __Pyx_Buffer *rcbuffer;
2388 __Pyx_Buf_DimInfo diminfo[8];
2389 } __Pyx_LocalBuf_ND;
2392 static int __pyx_memviewslice_is_contig(
const __Pyx_memviewslice mvs,
char order,
int ndim);
2395 static int __pyx_slices_overlap(__Pyx_memviewslice *slice1,
2396 __Pyx_memviewslice *slice2,
2397 int ndim,
size_t itemsize);
2400 static CYTHON_INLINE PyObject *__pyx_capsule_create(
void *p,
const char *sig);
2403 #if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6))
2404 #define __Pyx_HAS_GCC_DIAGNOSTIC
2408 static CYTHON_INLINE
int __Pyx_Is_Little_Endian(
void);
2411 static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx,
const char* ts);
2412 static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx,
2413 __Pyx_BufFmt_StackElem* stack,
2414 __Pyx_TypeInfo* type);
2417 static int __pyx_typeinfo_cmp(__Pyx_TypeInfo *a, __Pyx_TypeInfo *b);
2420 static int __Pyx_ValidateAndInit_memviewslice(
2425 __Pyx_TypeInfo *dtype,
2426 __Pyx_BufFmt_StackElem stack[],
2427 __Pyx_memviewslice *memviewslice,
2428 PyObject *original_obj);
2431 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dcd__float(PyObject *,
int writable_flag);
2434 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dcd__double(PyObject *,
int writable_flag);
2437 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_float(PyObject *,
int writable_flag);
2440 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_double(PyObject *,
int writable_flag);
2443 static __Pyx_memviewslice
2444 __pyx_memoryview_copy_new_contig(
const __Pyx_memviewslice *from_mvs,
2445 const char *mode,
int ndim,
2446 size_t sizeof_dtype,
int contig_flag,
2447 int dtype_is_object);
2450 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(
long value);
2453 static CYTHON_INLINE
int __Pyx_PyInt_As_int(PyObject *);
2456 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(
int value);
2459 static CYTHON_INLINE
long __Pyx_PyInt_As_long(PyObject *);
2462 static CYTHON_INLINE
char __Pyx_PyInt_As_char(PyObject *);
2465 static int __Pyx_check_binary_version(
void);
2468 static int __Pyx_ImportFunction_0_29_36(PyObject *module,
const char *funcname,
void (**f)(
void),
const char *sig);
2471 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);
2473 static PyObject *__pyx_array_get_memview(
struct __pyx_array_obj *__pyx_v_self);
2474 static char *__pyx_memoryview_get_item_pointer(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index);
2475 static PyObject *__pyx_memoryview_is_slice(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj);
2476 static PyObject *__pyx_memoryview_setitem_slice_assignment(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_dst, PyObject *__pyx_v_src);
2477 static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(
struct __pyx_memoryview_obj *__pyx_v_self,
struct __pyx_memoryview_obj *__pyx_v_dst, PyObject *__pyx_v_value);
2478 static PyObject *__pyx_memoryview_setitem_indexed(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value);
2479 static PyObject *__pyx_memoryview_convert_item_to_object(
struct __pyx_memoryview_obj *__pyx_v_self,
char *__pyx_v_itemp);
2480 static PyObject *__pyx_memoryview_assign_item_from_object(
struct __pyx_memoryview_obj *__pyx_v_self,
char *__pyx_v_itemp, PyObject *__pyx_v_value);
2481 static PyObject *__pyx_memoryviewslice_convert_item_to_object(
struct __pyx_memoryviewslice_obj *__pyx_v_self,
char *__pyx_v_itemp);
2482 static PyObject *__pyx_memoryviewslice_assign_item_from_object(
struct __pyx_memoryviewslice_obj *__pyx_v_self,
char *__pyx_v_itemp, PyObject *__pyx_v_value);
2491 static void (*__pyx_fuse_0__pyx_f_5imate_15_linear_algebra_17orthogonalization_orthogonalize_vectors)(
float *, __pyx_t_5imate_12_definitions_5types_LongIndexType const , __pyx_t_5imate_12_definitions_5types_IndexType const );
2492 static void (*__pyx_fuse_1__pyx_f_5imate_15_linear_algebra_17orthogonalization_orthogonalize_vectors)(
double *, __pyx_t_5imate_12_definitions_5types_LongIndexType const , __pyx_t_5imate_12_definitions_5types_IndexType const );
2493 static void (*__pyx_fuse_2__pyx_f_5imate_15_linear_algebra_17orthogonalization_orthogonalize_vectors)(
long double *, __pyx_t_5imate_12_definitions_5types_LongIndexType const , __pyx_t_5imate_12_definitions_5types_IndexType const );
2496 static void (*__pyx_fuse_0__pyx_f_5imate_15_linear_algebra_14random_vectors_generate_random_column_vectors)(
float *, __pyx_t_5imate_12_definitions_5types_LongIndexType const , __pyx_t_5imate_12_definitions_5types_IndexType const , __pyx_t_5imate_12_definitions_5types_IndexType const , __pyx_t_5imate_12_definitions_5types_IndexType const );
2497 static void (*__pyx_fuse_1__pyx_f_5imate_15_linear_algebra_14random_vectors_generate_random_column_vectors)(
double *, __pyx_t_5imate_12_definitions_5types_LongIndexType const , __pyx_t_5imate_12_definitions_5types_IndexType const , __pyx_t_5imate_12_definitions_5types_IndexType const , __pyx_t_5imate_12_definitions_5types_IndexType const );
2498 static void (*__pyx_fuse_2__pyx_f_5imate_15_linear_algebra_14random_vectors_generate_random_column_vectors)(
long double *, __pyx_t_5imate_12_definitions_5types_LongIndexType const , __pyx_t_5imate_12_definitions_5types_IndexType const , __pyx_t_5imate_12_definitions_5types_IndexType const , __pyx_t_5imate_12_definitions_5types_IndexType const );
2503 static PyTypeObject *__pyx_array_type = 0;
2504 static PyTypeObject *__pyx_MemviewEnum_type = 0;
2505 static PyTypeObject *__pyx_memoryview_type = 0;
2506 static PyTypeObject *__pyx_memoryviewslice_type = 0;
2507 static PyObject *
generic = 0;
2508 static PyObject *strided = 0;
2509 static PyObject *indirect = 0;
2510 static PyObject *contiguous = 0;
2511 static PyObject *indirect_contiguous = 0;
2512 static int __pyx_memoryview_thread_locks_used;
2513 static PyThread_type_lock __pyx_memoryview_thread_locks[8];
2514 static float __pyx_f_5imate_8traceinv_18_hutchinson_method__stochastic_trace_estimator_float(PyObject *, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *);
2515 static double __pyx_f_5imate_8traceinv_18_hutchinson_method__stochastic_trace_estimator_double(PyObject *, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *);
2516 static struct __pyx_array_obj *__pyx_array_new(PyObject *, Py_ssize_t,
char *,
char *,
char *);
2517 static void *__pyx_align_pointer(
void *,
size_t);
2518 static PyObject *__pyx_memoryview_new(PyObject *,
int,
int, __Pyx_TypeInfo *);
2519 static CYTHON_INLINE
int __pyx_memoryview_check(PyObject *);
2520 static PyObject *_unellipsify(PyObject *,
int);
2521 static PyObject *assert_direct_dimensions(Py_ssize_t *,
int);
2522 static struct __pyx_memoryview_obj *__pyx_memview_slice(
struct __pyx_memoryview_obj *, PyObject *);
2523 static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *, Py_ssize_t, Py_ssize_t, Py_ssize_t,
int,
int,
int *, Py_ssize_t, Py_ssize_t, Py_ssize_t,
int,
int,
int,
int);
2524 static char *__pyx_pybuffer_index(Py_buffer *,
char *, Py_ssize_t, Py_ssize_t);
2525 static int __pyx_memslice_transpose(__Pyx_memviewslice *);
2526 static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice,
int, PyObject *(*)(
char *),
int (*)(
char *, PyObject *),
int);
2527 static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(
struct __pyx_memoryview_obj *, __Pyx_memviewslice *);
2528 static void __pyx_memoryview_slice_copy(
struct __pyx_memoryview_obj *, __Pyx_memviewslice *);
2529 static PyObject *__pyx_memoryview_copy_object(
struct __pyx_memoryview_obj *);
2530 static PyObject *__pyx_memoryview_copy_object_from_slice(
struct __pyx_memoryview_obj *, __Pyx_memviewslice *);
2531 static Py_ssize_t abs_py_ssize_t(Py_ssize_t);
2532 static char __pyx_get_best_slice_order(__Pyx_memviewslice *,
int);
2533 static void _copy_strided_to_strided(
char *, Py_ssize_t *,
char *, Py_ssize_t *, Py_ssize_t *, Py_ssize_t *,
int,
size_t);
2534 static void copy_strided_to_strided(__Pyx_memviewslice *, __Pyx_memviewslice *,
int,
size_t);
2535 static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *,
int);
2536 static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *, Py_ssize_t *, Py_ssize_t,
int,
char);
2537 static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *, __Pyx_memviewslice *,
char,
int);
2538 static int __pyx_memoryview_err_extents(
int, Py_ssize_t, Py_ssize_t);
2539 static int __pyx_memoryview_err_dim(PyObject *,
char *,
int);
2540 static int __pyx_memoryview_err(PyObject *,
char *);
2541 static int __pyx_memoryview_copy_contents(__Pyx_memviewslice, __Pyx_memviewslice,
int,
int,
int);
2542 static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *,
int,
int);
2543 static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *,
int,
int,
int);
2544 static void __pyx_memoryview_refcount_objects_in_slice_with_gil(
char *, Py_ssize_t *, Py_ssize_t *,
int,
int);
2545 static void __pyx_memoryview_refcount_objects_in_slice(
char *, Py_ssize_t *, Py_ssize_t *,
int,
int);
2546 static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *,
int,
size_t,
void *,
int);
2547 static void __pyx_memoryview__slice_assign_scalar(
char *, Py_ssize_t *, Py_ssize_t *,
int,
size_t,
void *);
2548 static PyObject *__pyx_unpickle_Enum__set_state(
struct __pyx_MemviewEnum_obj *, PyObject *);
2549 static __Pyx_TypeInfo __Pyx_TypeInfo_float = {
"float", NULL,
sizeof(float), { 0 }, 0,
'R', 0, 0 };
2550 static __Pyx_TypeInfo __Pyx_TypeInfo_double = {
"double", NULL,
sizeof(double), { 0 }, 0,
'R', 0, 0 };
2551 #define __Pyx_MODULE_NAME "imate.traceinv._hutchinson_method"
2552 extern int __pyx_module_is_main_imate__traceinv___hutchinson_method;
2553 int __pyx_module_is_main_imate__traceinv___hutchinson_method = 0;
2556 static PyObject *__pyx_builtin_TypeError;
2557 static PyObject *__pyx_builtin_range;
2558 static PyObject *__pyx_builtin_RuntimeError;
2559 static PyObject *__pyx_builtin_ValueError;
2560 static PyObject *__pyx_builtin_MemoryError;
2561 static PyObject *__pyx_builtin_enumerate;
2562 static PyObject *__pyx_builtin_Ellipsis;
2563 static PyObject *__pyx_builtin_id;
2564 static PyObject *__pyx_builtin_IndexError;
2565 static const char __pyx_k_A[] =
"A";
2566 static const char __pyx_k_B[] =
"B";
2567 static const char __pyx_k_C[] =
"C";
2568 static const char __pyx_k_E[] =
"E";
2569 static const char __pyx_k_F[] =
"F";
2570 static const char __pyx_k_O[] =
"O";
2571 static const char __pyx_k_T[] =
"T";
2572 static const char __pyx_k_c[] =
"c";
2573 static const char __pyx_k_i[] =
"i";
2574 static const char __pyx_k_p[] =
"p";
2575 static const char __pyx_k_BE[] =
"BE";
2576 static const char __pyx_k_cE[] =
"cE";
2577 static const char __pyx_k_id[] =
"id";
2578 static const char __pyx_k_AtA[] =
"AtA";
2579 static const char __pyx_k_OpE[] =
"OpE";
2580 static const char __pyx_k_abs[] =
"abs";
2581 static const char __pyx_k_gen[] =
"gen";
2582 static const char __pyx_k_nan[] =
"nan";
2583 static const char __pyx_k_new[] =
"__new__";
2584 static const char __pyx_k_nnz[] =
"nnz";
2585 static const char __pyx_k_obj[] =
"obj";
2586 static const char __pyx_k_base[] =
"base";
2587 static const char __pyx_k_dict[] =
"__dict__";
2588 static const char __pyx_k_gram[] =
"gram";
2589 static const char __pyx_k_info[] =
"info";
2590 static const char __pyx_k_main[] =
"__main__";
2591 static const char __pyx_k_mode[] =
"mode";
2592 static const char __pyx_k_name[] =
"name";
2593 static const char __pyx_k_ndim[] =
"ndim";
2594 static const char __pyx_k_pack[] =
"pack";
2595 static const char __pyx_k_plot[] =
"plot";
2596 static const char __pyx_k_size[] =
"size";
2597 static const char __pyx_k_step[] =
"step";
2598 static const char __pyx_k_stop[] =
"stop";
2599 static const char __pyx_k_test[] =
"__test__";
2600 static const char __pyx_k_time[] =
"time";
2601 static const char __pyx_k_ASCII[] =
"ASCII";
2602 static const char __pyx_k_class[] =
"__class__";
2603 static const char __pyx_k_dtype[] =
"dtype";
2604 static const char __pyx_k_empty[] =
"empty";
2605 static const char __pyx_k_error[] =
"error";
2606 static const char __pyx_k_flags[] =
"flags";
2607 static const char __pyx_k_numpy[] =
"numpy";
2608 static const char __pyx_k_order[] =
"order";
2609 static const char __pyx_k_range[] =
"range";
2610 static const char __pyx_k_scipy[] =
"scipy";
2611 static const char __pyx_k_shape[] =
"shape";
2612 static const char __pyx_k_start[] =
"start";
2613 static const char __pyx_k_trace[] =
"trace";
2614 static const char __pyx_k_zeros[] =
"zeros";
2615 static const char __pyx_k_AinvpE[] =
"AinvpE";
2616 static const char __pyx_k_device[] =
"device";
2617 static const char __pyx_k_encode[] =
"encode";
2618 static const char __pyx_k_format[] =
"format";
2619 static const char __pyx_k_import[] =
"__import__";
2620 static const char __pyx_k_matmul[] =
"__matmul__";
2621 static const char __pyx_k_matrix[] =
"matrix";
2622 static const char __pyx_k_method[] =
"method";
2623 static const char __pyx_k_name_2[] =
"__name__";
2624 static const char __pyx_k_pickle[] =
"pickle";
2625 static const char __pyx_k_reduce[] =
"__reduce__";
2626 static const char __pyx_k_solver[] =
"solver";
2627 static const char __pyx_k_sparse[] =
"sparse";
2628 static const char __pyx_k_square[] =
"square";
2629 static const char __pyx_k_struct[] =
"struct";
2630 static const char __pyx_k_unpack[] =
"unpack";
2631 static const char __pyx_k_update[] =
"update";
2632 static const char __pyx_k_density[] =
"density";
2633 static const char __pyx_k_float32[] =
"float32";
2634 static const char __pyx_k_float64[] =
"float64";
2635 static const char __pyx_k_fortran[] =
"fortran";
2636 static const char __pyx_k_get_nnz[] =
"get_nnz";
2637 static const char __pyx_k_imatmul[] =
"__imatmul__";
2638 static const char __pyx_k_memview[] =
"memview";
2639 static const char __pyx_k_rmatmul[] =
"__rmatmul__";
2640 static const char __pyx_k_samples[] =
"samples";
2641 static const char __pyx_k_verbose[] =
"verbose";
2642 static const char __pyx_k_version[] =
"version";
2643 static const char __pyx_k_Ellipsis[] =
"Ellipsis";
2644 static const char __pyx_k_exponent[] =
"exponent";
2645 static const char __pyx_k_getstate[] =
"__getstate__";
2646 static const char __pyx_k_itemsize[] =
"itemsize";
2647 static const char __pyx_k_pyx_type[] =
"__pyx_type";
2648 static const char __pyx_k_setstate[] =
"__setstate__";
2649 static const char __pyx_k_TypeError[] =
"TypeError";
2650 static const char __pyx_k_converged[] =
"converged";
2651 static const char __pyx_k_cpu_count[] =
"cpu_count";
2652 static const char __pyx_k_data_type[] =
"data_type";
2653 static const char __pyx_k_enumerate[] =
"enumerate";
2654 static const char __pyx_k_pyx_state[] =
"__pyx_state";
2655 static const char __pyx_k_reduce_ex[] =
"__reduce_ex__";
2656 static const char __pyx_k_version_2[] =
"__version__";
2657 static const char __pyx_k_IndexError[] =
"IndexError";
2658 static const char __pyx_k_ValueError[] =
"ValueError";
2659 static const char __pyx_k_error_atol[] =
"error_atol";
2660 static const char __pyx_k_error_rtol[] =
"error_rtol";
2661 static const char __pyx_k_hutchinson[] =
"hutchinson";
2662 static const char __pyx_k_isspmatrix[] =
"isspmatrix";
2663 static const char __pyx_k_pyx_result[] =
"__pyx_result";
2664 static const char __pyx_k_pyx_vtable[] =
"__pyx_vtable__";
2665 static const char __pyx_k_solver_tol[] =
"solver_tol";
2666 static const char __pyx_k_MemoryError[] =
"MemoryError";
2667 static const char __pyx_k_PickleError[] =
"PickleError";
2668 static const char __pyx_k_convergence[] =
"convergence";
2669 static const char __pyx_k_get_density[] =
"get_density";
2670 static const char __pyx_k_num_threads[] =
"num_threads";
2671 static const char __pyx_k_return_info[] =
"return_info";
2672 static const char __pyx_k_vector_size[] =
"vector_size";
2673 static const char __pyx_k_RuntimeError[] =
"RuntimeError";
2674 static const char __pyx_k_memoryview_E[] =
"memoryview_E";
2675 static const char __pyx_k_num_outliers[] =
"num_outliers";
2676 static const char __pyx_k_operator_dot[] =
"_operator_dot";
2677 static const char __pyx_k_perf_counter[] =
"perf_counter";
2678 static const char __pyx_k_process_time[] =
"process_time";
2679 static const char __pyx_k_pyx_checksum[] =
"__pyx_checksum";
2680 static const char __pyx_k_samples_mean[] =
"samples_mean";
2681 static const char __pyx_k_scipy_sparse[] =
"scipy.sparse";
2682 static const char __pyx_k_stringsource[] =
"stringsource";
2683 static const char __pyx_k_alg_wall_time[] =
"alg_wall_time";
2684 static const char __pyx_k_assume_matrix[] =
"assume_matrix";
2685 static const char __pyx_k_cpu_proc_time[] =
"cpu_proc_time";
2686 static const char __pyx_k_linear_solver[] =
"linear_solver";
2687 static const char __pyx_k_num_inquiries[] =
"num_inquiries";
2688 static const char __pyx_k_orthogonalize[] =
"orthogonalize";
2689 static const char __pyx_k_print_summary[] =
"print_summary";
2690 static const char __pyx_k_pyx_getbuffer[] =
"__pyx_getbuffer";
2691 static const char __pyx_k_reduce_cython[] =
"__reduce_cython__";
2692 static const char __pyx_k_tot_wall_time[] =
"tot_wall_time";
2693 static const char __pyx_k_absolute_error[] =
"absolute_error";
2694 static const char __pyx_k_data_type_name[] =
"data_type_name";
2695 static const char __pyx_k_linear_algebra[] =
"_linear_algebra";
2696 static const char __pyx_k_relative_error[] =
"relative_error";
2697 static const char __pyx_k_View_MemoryView[] =
"View.MemoryView";
2698 static const char __pyx_k_allocate_buffer[] =
"allocate_buffer";
2699 static const char __pyx_k_check_arguments[] =
"check_arguments";
2700 static const char __pyx_k_dtype_is_object[] =
"dtype_is_object";
2701 static const char __pyx_k_max_num_samples[] =
"max_num_samples";
2702 static const char __pyx_k_min_num_samples[] =
"min_num_samples";
2703 static const char __pyx_k_multiprocessing[] =
"multiprocessing";
2704 static const char __pyx_k_num_cpu_threads[] =
"num_cpu_threads";
2705 static const char __pyx_k_num_gpu_devices[] =
"num_gpu_devices";
2706 static const char __pyx_k_pyx_PickleError[] =
"__pyx_PickleError";
2707 static const char __pyx_k_setstate_cython[] =
"__setstate_cython__";
2708 static const char __pyx_k_confidence_level[] =
"confidence_level";
2709 static const char __pyx_k_num_samples_used[] =
"num_samples_used";
2710 static const char __pyx_k_plot_convergence[] =
"plot_convergence";
2711 static const char __pyx_k_average_estimates[] =
"average_estimates";
2712 static const char __pyx_k_check_convergence[] =
"check_convergence";
2713 static const char __pyx_k_convergence_tools[] =
"_convergence_tools";
2714 static const char __pyx_k_hutchinson_method[] =
"hutchinson_method";
2715 static const char __pyx_k_pyx_unpickle_Enum[] =
"__pyx_unpickle_Enum";
2716 static const char __pyx_k_AtA_cannot_be_None[] =
"\"AtA\" cannot be None.";
2717 static const char __pyx_k_cline_in_traceback[] =
"cline_in_traceback";
2718 static const char __pyx_k_get_data_type_name[] =
"get_data_type_name";
2719 static const char __pyx_k_init_alg_wall_time[] =
"init_alg_wall_time";
2720 static const char __pyx_k_init_cpu_proc_time[] =
"init_cpu_proc_time";
2721 static const char __pyx_k_init_tot_wall_time[] =
"init_tot_wall_time";
2722 static const char __pyx_k_strided_and_direct[] =
"<strided and direct>";
2723 static const char __pyx_k_strided_and_indirect[] =
"<strided and indirect>";
2724 static const char __pyx_k_contiguous_and_direct[] =
"<contiguous and direct>";
2725 static const char __pyx_k_num_processed_samples[] =
"num_processed_samples";
2726 static const char __pyx_k_MemoryView_of_r_object[] =
"<MemoryView of %r object>";
2727 static const char __pyx_k_MemoryView_of_r_at_0x_x[] =
"<MemoryView of %r at 0x%x>";
2728 static const char __pyx_k_contiguous_and_indirect[] =
"<contiguous and indirect>";
2729 static const char __pyx_k_hutchinson_method_float[] =
"_hutchinson_method_float";
2730 static const char __pyx_k_num_gpu_multiprocessors[] =
"num_gpu_multiprocessors";
2731 static const char __pyx_k_samples_processed_order[] =
"samples_processed_order";
2732 static const char __pyx_k_Cannot_index_with_type_s[] =
"Cannot index with type '%s'";
2733 static const char __pyx_k_hutchinson_method_double[] =
"_hutchinson_method_double";
2734 static const char __pyx_k_Invalid_shape_in_axis_d_d[] =
"Invalid shape in axis %d: %d.";
2735 static const char __pyx_k_hutchinson_method_line_37[] =
"hutchinson_method (line 37)";
2736 static const char __pyx_k_processed_samples_indices[] =
"processed_samples_indices";
2737 static const char __pyx_k_outlier_significance_level[] =
"outlier_significance_level";
2738 static const char __pyx_k_hutchinson_method_utilities[] =
"_hutchinson_method_utilities";
2739 static const char __pyx_k_itemsize_0_for_cython_array[] =
"itemsize <= 0 for cython.array";
2740 static const char __pyx_k_unable_to_allocate_array_data[] =
"unable to allocate array data.";
2741 static const char __pyx_k_strided_and_direct_or_indirect[] =
"<strided and direct or indirect>";
2742 static const char __pyx_k_Trace_of_matrix_or_linear_opera[] =
"\n Trace of matrix or linear operator using stochastic Lanczos quadrature\n method.\n\n If `C` is `None`, given the matrices :math:`\\mathbf{A}` and\n :math:`\\mathbf{B}` and the integer exponent :math:`p`, the following is\n computed:\n\n .. math::\n\n \\mathrm{trace} \\left(\\mathbf{B} \\mathbf{A}^{-p} \\right).\n\n If `B` is `None`, it is assumed that :math:`\\mathbf{B}` is the identity\n matrix.\n\n If `C` is not `None`, given the matrix :math:`\\mathbf{C}`, the following\n is instead computed:\n\n .. math::\n\n \\mathrm{trace} \\left(\\mathbf{B} \\mathbf{A}^{-p} \\mathbf{C}\n \\mathbf{A}^{-p} \\right).\n\n If ``gram`` is `True`, then :math:`\\mathbf{A}` in the above is replaced by\n the Gramian matrix :math:`\\mathbf{A}^{\\intercal} \\mathbf{A}`. Namely, if\n `C` is `None`:\n\n .. math::\n\n \\mathrm{trace} \\left(\\mathbf{B}\n (\\mathbf{A}^{\\intercal}\\mathbf{A})^{-p} \\right),\n\n and if `C` is not `None`,\n\n .. math::\n\n \\mathrm{trace} \\left(\\mathbf{B}\n (\\mathbf{A}^{\\intercal}\\mathbf{A})^{-p} \\mathbf{C}\n (\\mathbf{A}^{\\intercal}\\mathbf{A})^{-p} \\right).\n\n Parameters\n ----------\n\n A : numpy.ndarray, scipy.sparse\n A sparse or dense matrix. If ``gram`` is `True`, the matrix can be\n non-square.\n\n .. note::\n\n In the Hutchinson method, the matrix cannot be a type of\n :class:`Matrix` or :class:`imate.AffineMatrixFunction` classes.\n\n gram : bool, default=False\n If `True`, the trace of the Gramian matrix,\n :math:`(\\mathbf{A}^{\\intercal}\\mathbf{A})^p`, is computed. The\n Gramian matrix itself is not directly computed. If `False`, the\n trace of :math:`\\mathbf{A}^p` is computed.\n\n p : float, default=1.0\n The integer exponent :math:`p` in :math:`\\mathbf{A}^{-p}`.\n\n return_info : bool, default=False\n If `True`, this functio""n also returns a dictionary containing\n information about the inner computation, such as process time,\n algorithm settings, etc.\n\n B : numpy.ndarray, scipy.sparse\n A sparse or dense matrix. `B` should be the same size and type of `A`.\n if `B` is `None`, it is assumed that `B` is the identity matrix.\n\n C : numpy.ndarray, scipy.sparse\n A sparse or dense matrix. `C` should be the same size and type of `A`.\n\n assume_matrix : str {'gen', 'sym', 'pos', 'sym_pos'}, default: 'gen'\n Type of matrix `A`:\n\n * ``gen`` assumes `A` is a generic matrix.\n * ``sym`` assumes `A` is symmetric.\n * ``pos`` assumes `A` is positive-definite.\n * ``sym_pos`` assumes `A` is symmetric and positive-definite.\n\n min_num_samples : int, default=10\n The minimum number of Monte-Carlo samples. If the convergence criterion\n is reached before finishing the minimum number of iterations, the\n iterations are forced to continue till the minimum number of iterations\n is finished. This value should be smaller than\n ``maximum_num_samples``.\n\n max_num_samples : int, default=50\n The maximum number of Monte-Carlo samples. If the convergence criterion\n is not reached by the maximum number of iterations, the iterations are\n forced to stop. This value should be larger than\n ``minimum_num_samples``.\n\n error_atol : float, default=None\n Tolerance of the absolute error of convergence of the output. Once the\n error of convergence reaches ``error_atol + error_rtol * output``, the\n iteration is terminated. If the convergence criterion is not met by the\n tolerance, then the iterations continue till reaching\n ``max_num_samples`` iterations. If `None`, the termination criterion\n does not depend on this parameter.\n\n error_rtol : float, default=None\n Tolerance of the relative error of con""vergence of the output. Once the\n error of convergence reaches ``error_atol + error_rtol * output``, the\n iteration is terminated. If the convergence criterion is not met by the\n tolerance, then the iterations continue till reaching\n ``max_num_samples`` iterations. If `None`, the termination criterion\n does not depend on this parameter.\n\n confidence_level : float, default=0.95\n Confidence level of error, which is a number between `0` and `1`. The\n error of convergence of the population of samples is defined by their\n standard deviation times the Z-score, which depends on the confidence\n level. See notes below for details.\n\n outlier_significance_level : float, default=0.001\n One minus the confidence level of the uncertainty of the outliers of\n the output samples. This is a number between `0` and `1`.\n\n solver_tol : float, default=1e-6\n Tolerance of solving linear system.\n\n orthogonalize : int, default=0\n If `True`, it orthogonalizes the set of random vectors used for\n Monte-Carlo sampling. This might lead to a better estimation of the\n output.\n\n num_threads : int, default=0\n Number of processor threads to employ for parallel computation on CPU.\n If set to `0` or a number larger than the available number of threads,\n all threads of the processor are used. The parallelization is performed\n over the Monte-Carlo iterations.\n\n verbose : bool, default=False\n Prints extra information about the computations.\n\n plot : bool, default=False\n Plots convergence of samples. For this, the packages `matplotlib` and\n `seaborn` should be installed. If no display is available (such as\n running this code on remote machines), the plots are saved as an `SVG`\n file in the current directory.\n\n Returns\n -------\n\n traceinv : float or numpy.array\n Tr""ace of inverse of matrix.\n\n info : dict\n (Only if ``return_info`` is `True`) A dictionary of information with\n the following.\n\n * ``matrix``:\n * ``data_type``: `str`, {`float32`, `float64`, `float128`}. Type of\n the matrix data.\n * ``gram``: `bool`, whether the matrix `A` or its Gramian is\n considered.\n * ``exponent``: `float`, the exponent `p` in :math:`\\mathbf{A}^p`.\n * ``assume_matrix``: `str`, {`gen`, `sym`, `pos`, `sym_pos`},\n determines the type of matrix `A`.\n * ``size``: (int, int) The size of matrix `A`.\n * ``sparse``: `bool`, whether the matrix `A` is sparse or dense.\n * ``nnz``: `int`, if `A` is sparse, the number of non-zero elements\n of `A`.\n * ``density``: `float`, if `A` is sparse, the density of `A`, which\n is the `nnz` divided by size squared.\n * ``num_inquiries``: `int`, the size of inquiries of each parameter\n of the linear operator `A`. If `A` is a matrix, this is always\n `1`. If `A` is a type of :class:`AffineMatrixFunction`, this\n value is the number of :math:`t_i` parameters.\n\n * ``convergence``:\n * ``converged``: `bool`, whether the Monte-Carlo sampling\n converged.\n * ``min_num_samples``: `int`, the minimum number of Monte-Carlo\n iterations.\n * ``max_num_samples``: `int`, the maximum number of Monte-Carlo\n iterations.\n * ``num_outliers``: `int`, number of outliers found during search\n for outliers among the array of output.\n * ``num_samples_used``: `int`, number of Monte-Carlo samples used\n to produce the output. This is the total number of iterations\n minus the number of outliers.\n * ``samples``: `array` [`float`], an array of the si""ze\n `max_num_samples`. The first few entries (`num_samples_used`) of\n this array are the output results of the Monte-Carlo sampling.\n The average of these samples is the final result. The rest of\n this array is `nan`.\n * ``samples_mean``: `float`, mean of the `samples` array, excluding\n the `nan` values.\n * ``samples_processed_order``: `array` [`int`], in parallel\n processing, samples are processed in non-sequential order. This\n array, which has the same size as `samples`, keeps track of the\n order in which each sample is processed.\n\n * ``error``:\n * ``absolute_error``: `float`, the absolute error of the\n convergence of samples.\n * ``confidence_level``: `float`, the confidence level used to\n calculate the error from standard deviation of samples.\n * ``error_atol``: `float`, the tolerance of absolute error of the\n convergence of samples.\n * ``error_rtol``: `float`, the tolerance of relative error of the\n convergence of samples.\n * ``outlier_significance_level``: `float`, the significance level\n used to determine the outliers in samples.\n * ``relative_error``: `float`, the relative error of the\n convergence of samples.\n\n * ``device``:\n * ``num_cpu_threads``: `int`, number of CPU threads used in shared\n memory parallel processing.\n * ``num_gpu_devices``: `int`, number of GPU devices used in the\n multi-GPU (GPU farm) computation.\n * ``num_gpu_multiprocessors``: `int`, number of GPU\n multi-processors.\n * ``num_gpu_threads_per_multiprocessor``: `int`, number of GPU\n threads on each GPU multi-processor.\n\n * ``time``:\n * ``tot_wall_time``: `float`"", total elapsed time of computation.\n * ``alg_wall_time``: `float`, elapsed time of computation during\n only the algorithm execution.\n * ``cpu_proc_time``: `float`, the CPU processing time of\n computation.\n\n * ``solver``:\n * ``version``: `str`, version of imate.\n * ``method``: 'hutchinson'.\n * ``solver_tol``: `float`, tolerance of solving linear system.\n * ``orthogonalize``: `bool`, orthogonalization flag.\n\n Raises\n ------\n\n ImportError\n If the package has not been compiled with GPU support, but ``gpu`` is\n set to `True`. To resolve the issue, set ``gpu`` to `False` to be able\n to use the existing installation. Alternatively, export the\n environment variable ``USE_CUDA=1`` and recompile the source code of\n the package.\n\n See Also\n --------\n\n imate.logdet\n imate.trace\n imate.schatten\n\n Notes\n -----\n\n **Computational Complexity:**\n\n This method uses the Hutchinson, which is a randomized algorithm. The\n computational complexity of this method is\n\n .. math::\n\n \\mathcal{O}((\\rho n^2s),\n\n where :math:`n` is the matrix size, :math:`\\rho` is the density of\n sparse matrix (for dense matrix, :math:`\\rho=1`), and :math:`s` is the\n number of samples (set with ``min_num_samples`` and ``max_num_samples``).\n\n This method can be used on very large matrices (:math:`n > 2^{12}`). The\n solution is an approximation.\n\n **Convergence criterion:**\n\n Let :math:`n_{\\min}` and :math:`n_{\\max}` be the minimum and maximum\n number of iterations respectively defined by ``min_num_samples`` and\n ``max_num_samples``. The iterations terminate at\n :math:`n_{\\min} \\leq i \\leq n_{\\max}` where :math:`i` is the\n iteration counter. The iterations stop earlier at :math:`i < n_{\\max}` if\n the convergence error of the mean of t""he samples is satisfied, as follows.\n\n Suppose :math:`s(j)` and :math:`\\sigma(i)` are respectively the mean and\n standard deviation of samples after :math:`j` iterations. The error of\n convergence, :math:`e(j)`, is defined by\n\n .. math::\n\n e(j) = \\frac{\\sigma(j)}{\\sqrt{j}} Z\n\n where :math:`Z` is the Z-score defined by\n\n .. math::\n\n Z = \\sqrt{2} \\mathrm{erf}^{-1}(\\phi).\n\n In the above, :math:`\\phi` is the confidence level and set by\n ``confidence_level`` argument, and :math:`\\mathrm{erf}^{-1}` is the\n inverse error function. A confidence level of 95%, for instance, means that\n the Z-score is 1.96, which means the confidence interval is\n :math:`\\pm 1.96 \\sigma`.\n\n The termination criterion is\n\n .. math::\n\n e(j) < \\epsilon_a + s(j) \\epsilon_r,\n\n where :math:`\\epsilon_{a}` and :math:`\\epsilon_r` are the absolute and\n relative error tolerances respectively, and they are set by ``error_atol``\n and ``error_rtol``.\n\n **Plotting:**\n\n If ``plot`` is set to `True`, it plots the convergence of samples and their\n relative error.\n\n * If no graphical backend exists (such as running the code on a remote\n server or manually disabling the X11 backend), the plot will not be\n shown, rather, it will be saved as an ``svg`` file in the current\n directory.\n * If the executable ``latex`` is available on ``PATH``, the plot is\n rendered using :math:`\\rm\\LaTeX` and it may take slightly longer to\n produce the plot.\n * If :math:`\\rm\\LaTeX` is not installed, it uses any available San-Serif\n font to render the plot.\n\n To manually disable interactive plot display and save the plot as\n ``svg`` instead, add the following at the very beginning of your code\n before importing :mod:`imate`:\n\n .. code-block:: python\n\n >>> import os\n >>> os.environ['IMATE_NO_DISPLAY'] = 'True'\n\n References""\n ----------\n\n * `Ubaru, S., Chen, J., and Saad, Y. (2017)\n <https://www-users.cs.umn.edu/~saad/PDF/ys-2016-04.pdf>`_,\n Fast Estimation of :math:`\\mathrm{tr}(F(A))` Via Stochastic Lanczos\n Quadrature, SIAM J. Matrix Anal. Appl., 38(4), 1075-1099.\n\n Examples\n --------\n\n **Basic Usage:**\n\n Compute the trace of :math:`\\mathbf{A}^{-2}`:\n\n .. code-block:: python\n\n >>> # Import packages\n >>> from imate import toeplitz, traceinv\n\n >>> # Generate a sample matrix\n >>> A = toeplitz(2, 1, size=100)\n\n >>> # Compute trace of inverse\n >>> traceinv(A, p=2, method='hutchinson')\n 24.73726368966402\n\n Compute the trace of :math:`(\\mathbf{A}^{\\intercal} \\mathbf{A})^{-2}`:\n\n .. code-block:: python\n\n >>> # Using Gramian matrix of A\n >>> traceinv(A, gram=True, p=2, method='hutchinson')\n 17.751659383784748\n\n Compute the trace of :math:`\\mathbf{B} \\mathbf{A}^{-2}`:\n\n .. code-block:: python\n\n >>> # Generate another sample matrix\n >>> B = toeplitz(4, 3, size=100)\n\n >>> # Using Gramian matrix of A\n >>> traceinv(A, p=2, method='hutchinson', B=B)\n 99.8817360381704\n\n Compute the trace of :math:`\\mathbf{B} \\mathbf{A}^{-2} \\mathbf{C}\n \\mathbf{A}^{-2}`:\n\n .. code-block:: python\n\n >>> # Generate another sample matrix\n >>> C = toeplitz(5, 4, size=100)\n\n >>> # Using Gramian matrix of A\n >>> traceinv(A, p=2, method='hutchinson', B=B, C=C)\n 124.45436379980006\n\n Compute the trace of :math:`\\mathbf{B} (\\mathbf{A}^{\\intercal}\n \\mathbf{A})^{-2} \\mathbf{C} (\\mathbf{A}^{\\intercal} \\mathbf{A})^{-2}`:\n\n .. code-block:: python\n\n >>> # Using Gramian matrix of A\n >>> traceinv(A, gram=True, p=2, method='hutchinson', B=B, C=C)\n 5.517453125230929\n\n **Verbose output:**\n\n By setting ``verbose`` to `True`,"" useful info about the process is\n printed.\n\n .. literalinclude:: ../_static/data/imate.traceinv.hutchinson-verbose.txt\n :language: python\n\n **Output information:**\n\n Print information about the inner computation:\n\n .. code-block:: python\n\n >>> ti, info = traceinv(A, method='hutchinson', return_info=True)\n >>> print(ti)\n 50.059307947603585\n\n >>> # Print dictionary neatly using pprint\n >>> from pprint import pprint\n >>> pprint(info)\n {\n 'matrix': {\n 'assume_matrix': 'gen',\n 'data_type': b'float64',\n 'density': 0.0199,\n 'exponent': 1,\n 'gram': False,\n 'nnz': 199,\n 'num_inquiries': 1,\n 'size': (100, 100),\n 'sparse': True\n },\n 'convergence': {\n 'converged': False,\n 'max_num_samples': 50,\n 'min_num_samples': 10,\n 'num_outliers': 0,\n 'num_samples_used': 50,\n 'samples': array([52.237154, ..., 51.37932704]),\n 'samples_mean': 50.059307947603585,\n 'samples_processed_order': array([ 0, ..., 49])\n },\n 'error': {\n 'absolute_error': 0.8111131801161796,\n 'confidence_level': 0.95,\n 'error_atol': 0.0,\n 'error_rtol': 0.01,\n 'outlier_significance_level': 0.001,\n 'relative_error': 0.016203044216375525\n },\n 'solver': {\n 'method': 'hutchinson',\n 'orthogonalize': True,\n 'solver_tol': 1e-06,\n 'version': '0.16.0'\n },\n 'device': {\n 'num_cpu_threads': 8,\n 'num_gpu_devices': 0,\n 'num_gpu_multiprocessors': 0,\n '""num_gpu_threads_per_multiprocessor': 0\n },\n 'time': {\n 'alg_wall_time': 0.03236744087189436,\n 'cpu_proc_time': 0.047695197999999994,\n 'tot_wall_time': 0.033352302853018045\n }\n }\n\n **Large matrix:**\n\n Compute the trace of :math:`\\mathbf{A}^{-1}` for a very large sparse\n matrix using at least `100` samples.\n\n .. code-block:: python\n :emphasize-lines: 5, 6, 7\n\n >>> # Create a symmetric positive-definite matrix of size one million.\n >>> A = toeplitz(2, 1, size=1000000, gram=True)\n\n >>> # Approximate trace using hutchinson method\n >>> ti, info = traceinv(A, method='hutchinson', solver_tol=1e-4,\n ... assume_matrix='sym_pos', min_num_samples=100,\n ... max_num_samples=200, return_info=True)\n >>> print(ti)\n 333292.3226031165\n\n >>> # Find the time it took to compute the above\n >>> print(info['time'])\n {\n 'tot_wall_time': 175.93423152901232,\n 'alg_wall_time': 119.86316476506181,\n 'cpu_proc_time': 572.180877451\n }\n\n Compare the result of the above approximation with the exact solution of\n the trace using the analytic relation for Toeplitz matrix. See\n :func:`imate.sample_matrices.toeplitz_traceinv` for details.\n\n .. code-block:: python\n\n >>> from imate.sample_matrices import toeplitz_traceinv\n >>> toeplitz_traceinv(2, 1, size=1000000, gram=True)\n 333333.2222222222\n\n It can be seen that the error of approximation is :math:`0.012 \\%`. This\n accuracy is remarkable considering that the computation on such a large\n matrix took on 119 seconds. Computing the trace of such a large matrix\n using any of the exact methods (such as ``exact`` or ``eigenvalue``) is\n infeasible.\n\n **Plotting:**\n\n By setting ``plot`` to `True`, plots ""of samples during Monte-Carlo\n iterations and the convergence of their mean are generated.\n\n .. code-block:: python\n\n >>> A = toeplitz(2, 1, size=1000000, gram=True)\n >>> traceinv(A, method='hutchinson', assume_matrix='sym_pos',\n ... solver_tol=1e-4, min_num_samples=50, max_num_samples=150,\n ... error_rtol=2e-4, confidence_level=0.95,\n ... outlier_significance_level=0.001, plot=True)\n\n .. image:: ../_static/images/plots/traceinv_hutchinson_convergence.png\n :align: center\n :class: custom-dark\n\n In the left plot, the samples are shown in circles and the cumulative mean\n of the samples is shown by a solid black curve. The shaded area corresponds\n to the 95% confidence interval :math:`\\pm 1.96 \\sigma`, which is set by\n ``confidence_level=0.95``. The samples outside the interval of 99.9% are\n considered outliers, which is set by the significance level\n ``outlier_significance_level=0.001``.\n\n In the right plot, the darker shaded area in the interval :math:`[0, 50]`\n shows the minimum number of samples and is set by ``min_num_samples=50``.\n The iterations do not stop till the minimum number of iterations is passed.\n We can observe that sampling is terminated after 140 iterations where the\n relative error of samples reaches 0.02% since we set ``error_rtol=2e-4``.\n The lighter shaded area in the interval :math:`[140, 150]` corresponds to\n the iterations that were not performed to reach the specified maximum\n iterations by ``max_num_samples=150``.\n ";
2743 static const char __pyx_k_linear_algebra_matrix_utilities[] =
"_linear_algebra.matrix_utilities";
2744 static const char __pyx_k_trace_estimator_trace_estimator[] =
"_trace_estimator.trace_estimator_plot_utilities";
2745 static const char __pyx_k_Buffer_view_does_not_expose_stri[] =
"Buffer view does not expose strides";
2746 static const char __pyx_k_Can_only_create_a_buffer_that_is[] =
"Can only create a buffer that is contiguous in memory.";
2747 static const char __pyx_k_Cannot_assign_to_read_only_memor[] =
"Cannot assign to read-only memoryview";
2748 static const char __pyx_k_Cannot_create_writable_memory_vi[] =
"Cannot create writable memory view from read-only memoryview";
2749 static const char __pyx_k_Data_type_should_be_either_float[] =
"Data type should be either \"float32\" or \"float64\"";
2750 static const char __pyx_k_Empty_shape_tuple_for_cython_arr[] =
"Empty shape tuple for cython.array";
2751 static const char __pyx_k_Incompatible_checksums_0x_x_vs_0[] =
"Incompatible checksums (0x%x vs (0xb068931, 0x82a3537, 0x6ae9995) = (name))";
2752 static const char __pyx_k_Indirect_dimensions_not_supporte[] =
"Indirect dimensions not supported";
2753 static const char __pyx_k_Invalid_mode_expected_c_or_fortr[] =
"Invalid mode, expected 'c' or 'fortran', got %s";
2754 static const char __pyx_k_Out_of_bounds_on_buffer_access_a[] =
"Out of bounds on buffer access (axis %d)";
2755 static const char __pyx_k_Unable_to_convert_item_to_object[] =
"Unable to convert item to object";
2756 static const char __pyx_k_got_differing_extents_in_dimensi[] =
"got differing extents in dimension %d (got %d and %d)";
2757 static const char __pyx_k_imate_traceinv__hutchinson_metho[] =
"imate/traceinv/_hutchinson_method.pyx";
2758 static const char __pyx_k_no_default___reduce___due_to_non[] =
"no default __reduce__ due to non-trivial __cinit__";
2759 static const char __pyx_k_num_gpu_threads_per_multiprocess[] =
"num_gpu_threads_per_multiprocessor";
2760 static const char __pyx_k_unable_to_allocate_shape_and_str[] =
"unable to allocate shape and strides.";
2761 static const char __pyx_k_imate_traceinv__hutchinson_metho_2[] =
"imate.traceinv._hutchinson_method";
2762 static PyObject *__pyx_n_s_A;
2763 static PyObject *__pyx_n_s_ASCII;
2764 static PyObject *__pyx_n_s_AinvpE;
2765 static PyObject *__pyx_n_s_AtA;
2766 static PyObject *__pyx_kp_u_AtA_cannot_be_None;
2767 static PyObject *__pyx_n_s_B;
2768 static PyObject *__pyx_n_s_BE;
2769 static PyObject *__pyx_kp_s_Buffer_view_does_not_expose_stri;
2770 static PyObject *__pyx_n_s_C;
2771 static PyObject *__pyx_kp_s_Can_only_create_a_buffer_that_is;
2772 static PyObject *__pyx_kp_s_Cannot_assign_to_read_only_memor;
2773 static PyObject *__pyx_kp_s_Cannot_create_writable_memory_vi;
2774 static PyObject *__pyx_kp_s_Cannot_index_with_type_s;
2775 static PyObject *__pyx_kp_u_Data_type_should_be_either_float;
2776 static PyObject *__pyx_n_s_E;
2777 static PyObject *__pyx_n_s_Ellipsis;
2778 static PyObject *__pyx_kp_s_Empty_shape_tuple_for_cython_arr;
2779 static PyObject *__pyx_n_u_F;
2780 static PyObject *__pyx_kp_s_Incompatible_checksums_0x_x_vs_0;
2781 static PyObject *__pyx_n_s_IndexError;
2782 static PyObject *__pyx_kp_s_Indirect_dimensions_not_supporte;
2783 static PyObject *__pyx_kp_s_Invalid_mode_expected_c_or_fortr;
2784 static PyObject *__pyx_kp_s_Invalid_shape_in_axis_d_d;
2785 static PyObject *__pyx_n_s_MemoryError;
2786 static PyObject *__pyx_kp_s_MemoryView_of_r_at_0x_x;
2787 static PyObject *__pyx_kp_s_MemoryView_of_r_object;
2788 static PyObject *__pyx_n_b_O;
2789 static PyObject *__pyx_n_s_OpE;
2790 static PyObject *__pyx_kp_s_Out_of_bounds_on_buffer_access_a;
2791 static PyObject *__pyx_n_s_PickleError;
2792 static PyObject *__pyx_n_s_RuntimeError;
2793 static PyObject *__pyx_n_s_T;
2794 static PyObject *__pyx_kp_u_Trace_of_matrix_or_linear_opera;
2795 static PyObject *__pyx_n_s_TypeError;
2796 static PyObject *__pyx_kp_s_Unable_to_convert_item_to_object;
2797 static PyObject *__pyx_n_s_ValueError;
2798 static PyObject *__pyx_n_s_View_MemoryView;
2799 static PyObject *__pyx_n_s_abs;
2800 static PyObject *__pyx_n_u_absolute_error;
2801 static PyObject *__pyx_n_s_alg_wall_time;
2802 static PyObject *__pyx_n_u_alg_wall_time;
2803 static PyObject *__pyx_n_s_allocate_buffer;
2804 static PyObject *__pyx_n_s_assume_matrix;
2805 static PyObject *__pyx_n_u_assume_matrix;
2806 static PyObject *__pyx_n_s_average_estimates;
2807 static PyObject *__pyx_n_s_base;
2808 static PyObject *__pyx_n_s_c;
2809 static PyObject *__pyx_n_u_c;
2810 static PyObject *__pyx_n_s_cE;
2811 static PyObject *__pyx_n_s_check_arguments;
2812 static PyObject *__pyx_n_s_check_convergence;
2813 static PyObject *__pyx_n_s_class;
2814 static PyObject *__pyx_n_s_cline_in_traceback;
2815 static PyObject *__pyx_n_s_confidence_level;
2816 static PyObject *__pyx_n_u_confidence_level;
2817 static PyObject *__pyx_kp_s_contiguous_and_direct;
2818 static PyObject *__pyx_kp_s_contiguous_and_indirect;
2819 static PyObject *__pyx_n_s_converged;
2820 static PyObject *__pyx_n_u_converged;
2821 static PyObject *__pyx_n_u_convergence;
2822 static PyObject *__pyx_n_s_convergence_tools;
2823 static PyObject *__pyx_n_s_cpu_count;
2824 static PyObject *__pyx_n_s_cpu_proc_time;
2825 static PyObject *__pyx_n_u_cpu_proc_time;
2826 static PyObject *__pyx_n_u_data_type;
2827 static PyObject *__pyx_n_s_data_type_name;
2828 static PyObject *__pyx_n_u_density;
2829 static PyObject *__pyx_n_u_device;
2830 static PyObject *__pyx_n_s_dict;
2831 static PyObject *__pyx_n_s_dtype;
2832 static PyObject *__pyx_n_s_dtype_is_object;
2833 static PyObject *__pyx_n_s_empty;
2834 static PyObject *__pyx_n_s_encode;
2835 static PyObject *__pyx_n_s_enumerate;
2836 static PyObject *__pyx_n_s_error;
2837 static PyObject *__pyx_n_u_error;
2838 static PyObject *__pyx_n_s_error_atol;
2839 static PyObject *__pyx_n_u_error_atol;
2840 static PyObject *__pyx_n_s_error_rtol;
2841 static PyObject *__pyx_n_u_error_rtol;
2842 static PyObject *__pyx_n_u_exponent;
2843 static PyObject *__pyx_n_s_flags;
2844 static PyObject *__pyx_n_b_float32;
2845 static PyObject *__pyx_n_s_float32;
2846 static PyObject *__pyx_n_b_float64;
2847 static PyObject *__pyx_n_s_float64;
2848 static PyObject *__pyx_n_s_format;
2849 static PyObject *__pyx_n_s_fortran;
2850 static PyObject *__pyx_n_u_fortran;
2851 static PyObject *__pyx_n_u_gen;
2852 static PyObject *__pyx_n_s_get_data_type_name;
2853 static PyObject *__pyx_n_s_get_density;
2854 static PyObject *__pyx_n_s_get_nnz;
2855 static PyObject *__pyx_n_s_getstate;
2856 static PyObject *__pyx_kp_s_got_differing_extents_in_dimensi;
2857 static PyObject *__pyx_n_s_gram;
2858 static PyObject *__pyx_n_u_gram;
2859 static PyObject *__pyx_n_u_hutchinson;
2860 static PyObject *__pyx_n_s_hutchinson_method;
2861 static PyObject *__pyx_n_s_hutchinson_method_double;
2862 static PyObject *__pyx_n_s_hutchinson_method_float;
2863 static PyObject *__pyx_kp_u_hutchinson_method_line_37;
2864 static PyObject *__pyx_n_s_hutchinson_method_utilities;
2865 static PyObject *__pyx_n_s_i;
2866 static PyObject *__pyx_n_s_id;
2867 static PyObject *__pyx_kp_s_imate_traceinv__hutchinson_metho;
2868 static PyObject *__pyx_n_s_imate_traceinv__hutchinson_metho_2;
2869 static PyObject *__pyx_n_s_imatmul;
2870 static PyObject *__pyx_n_s_import;
2871 static PyObject *__pyx_n_s_info;
2872 static PyObject *__pyx_n_s_init_alg_wall_time;
2873 static PyObject *__pyx_n_s_init_cpu_proc_time;
2874 static PyObject *__pyx_n_s_init_tot_wall_time;
2875 static PyObject *__pyx_n_s_isspmatrix;
2876 static PyObject *__pyx_n_s_itemsize;
2877 static PyObject *__pyx_kp_s_itemsize_0_for_cython_array;
2878 static PyObject *__pyx_n_s_linear_algebra;
2879 static PyObject *__pyx_n_s_linear_algebra_matrix_utilities;
2880 static PyObject *__pyx_n_s_linear_solver;
2881 static PyObject *__pyx_n_s_main;
2882 static PyObject *__pyx_n_s_matmul;
2883 static PyObject *__pyx_n_u_matrix;
2884 static PyObject *__pyx_n_s_max_num_samples;
2885 static PyObject *__pyx_n_u_max_num_samples;
2886 static PyObject *__pyx_n_s_memoryview_E;
2887 static PyObject *__pyx_n_s_memview;
2888 static PyObject *__pyx_n_u_method;
2889 static PyObject *__pyx_n_s_min_num_samples;
2890 static PyObject *__pyx_n_u_min_num_samples;
2891 static PyObject *__pyx_n_s_mode;
2892 static PyObject *__pyx_n_s_multiprocessing;
2893 static PyObject *__pyx_n_s_name;
2894 static PyObject *__pyx_n_s_name_2;
2895 static PyObject *__pyx_n_s_nan;
2896 static PyObject *__pyx_n_s_ndim;
2897 static PyObject *__pyx_n_s_new;
2898 static PyObject *__pyx_n_u_nnz;
2899 static PyObject *__pyx_kp_s_no_default___reduce___due_to_non;
2900 static PyObject *__pyx_n_u_num_cpu_threads;
2901 static PyObject *__pyx_n_u_num_gpu_devices;
2902 static PyObject *__pyx_n_u_num_gpu_multiprocessors;
2903 static PyObject *__pyx_n_u_num_gpu_threads_per_multiprocess;
2904 static PyObject *__pyx_n_u_num_inquiries;
2905 static PyObject *__pyx_n_s_num_outliers;
2906 static PyObject *__pyx_n_u_num_outliers;
2907 static PyObject *__pyx_n_s_num_processed_samples;
2908 static PyObject *__pyx_n_s_num_samples_used;
2909 static PyObject *__pyx_n_u_num_samples_used;
2910 static PyObject *__pyx_n_s_num_threads;
2911 static PyObject *__pyx_n_s_numpy;
2912 static PyObject *__pyx_n_s_obj;
2913 static PyObject *__pyx_n_s_operator_dot;
2914 static PyObject *__pyx_n_s_order;
2915 static PyObject *__pyx_n_s_orthogonalize;
2916 static PyObject *__pyx_n_u_orthogonalize;
2917 static PyObject *__pyx_n_s_outlier_significance_level;
2918 static PyObject *__pyx_n_u_outlier_significance_level;
2919 static PyObject *__pyx_n_s_p;
2920 static PyObject *__pyx_n_s_pack;
2921 static PyObject *__pyx_n_s_perf_counter;
2922 static PyObject *__pyx_n_s_pickle;
2923 static PyObject *__pyx_n_s_plot;
2924 static PyObject *__pyx_n_s_plot_convergence;
2925 static PyObject *__pyx_n_s_print_summary;
2926 static PyObject *__pyx_n_s_process_time;
2927 static PyObject *__pyx_n_s_processed_samples_indices;
2928 static PyObject *__pyx_n_s_pyx_PickleError;
2929 static PyObject *__pyx_n_s_pyx_checksum;
2930 static PyObject *__pyx_n_s_pyx_getbuffer;
2931 static PyObject *__pyx_n_s_pyx_result;
2932 static PyObject *__pyx_n_s_pyx_state;
2933 static PyObject *__pyx_n_s_pyx_type;
2934 static PyObject *__pyx_n_s_pyx_unpickle_Enum;
2935 static PyObject *__pyx_n_s_pyx_vtable;
2936 static PyObject *__pyx_n_s_range;
2937 static PyObject *__pyx_n_s_reduce;
2938 static PyObject *__pyx_n_s_reduce_cython;
2939 static PyObject *__pyx_n_s_reduce_ex;
2940 static PyObject *__pyx_n_u_relative_error;
2941 static PyObject *__pyx_n_s_return_info;
2942 static PyObject *__pyx_n_s_rmatmul;
2943 static PyObject *__pyx_n_s_samples;
2944 static PyObject *__pyx_n_u_samples;
2945 static PyObject *__pyx_n_u_samples_mean;
2946 static PyObject *__pyx_n_u_samples_processed_order;
2947 static PyObject *__pyx_n_s_scipy;
2948 static PyObject *__pyx_n_s_scipy_sparse;
2949 static PyObject *__pyx_n_s_setstate;
2950 static PyObject *__pyx_n_s_setstate_cython;
2951 static PyObject *__pyx_n_s_shape;
2952 static PyObject *__pyx_n_s_size;
2953 static PyObject *__pyx_n_u_size;
2954 static PyObject *__pyx_n_u_solver;
2955 static PyObject *__pyx_n_s_solver_tol;
2956 static PyObject *__pyx_n_u_solver_tol;
2957 static PyObject *__pyx_n_u_sparse;
2958 static PyObject *__pyx_n_s_square;
2959 static PyObject *__pyx_n_s_start;
2960 static PyObject *__pyx_n_s_step;
2961 static PyObject *__pyx_n_s_stop;
2962 static PyObject *__pyx_kp_s_strided_and_direct;
2963 static PyObject *__pyx_kp_s_strided_and_direct_or_indirect;
2964 static PyObject *__pyx_kp_s_strided_and_indirect;
2965 static PyObject *__pyx_kp_s_stringsource;
2966 static PyObject *__pyx_n_s_struct;
2967 static PyObject *__pyx_n_s_test;
2968 static PyObject *__pyx_n_s_time;
2969 static PyObject *__pyx_n_u_time;
2970 static PyObject *__pyx_n_s_tot_wall_time;
2971 static PyObject *__pyx_n_u_tot_wall_time;
2972 static PyObject *__pyx_n_s_trace;
2973 static PyObject *__pyx_n_s_trace_estimator_trace_estimator;
2974 static PyObject *__pyx_kp_s_unable_to_allocate_array_data;
2975 static PyObject *__pyx_kp_s_unable_to_allocate_shape_and_str;
2976 static PyObject *__pyx_n_s_unpack;
2977 static PyObject *__pyx_n_s_update;
2978 static PyObject *__pyx_n_s_vector_size;
2979 static PyObject *__pyx_n_s_verbose;
2980 static PyObject *__pyx_n_u_version;
2981 static PyObject *__pyx_n_s_version_2;
2982 static PyObject *__pyx_n_s_zeros;
2983 static PyObject *__pyx_pf_5imate_8traceinv_18_hutchinson_method_hutchinson_method(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_gram, PyObject *__pyx_v_p, PyObject *__pyx_v_return_info, PyObject *__pyx_v_B, PyObject *__pyx_v_C, PyObject *__pyx_v_assume_matrix, PyObject *__pyx_v_min_num_samples, PyObject *__pyx_v_max_num_samples, PyObject *__pyx_v_error_atol, PyObject *__pyx_v_error_rtol, PyObject *__pyx_v_confidence_level, PyObject *__pyx_v_outlier_significance_level, PyObject *__pyx_v_solver_tol, PyObject *__pyx_v_orthogonalize, PyObject *__pyx_v_num_threads, PyObject *__pyx_v_verbose, PyObject *__pyx_v_plot);
2984 static PyObject *__pyx_pf_5imate_8traceinv_18_hutchinson_method_2_hutchinson_method_float(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_B, PyObject *__pyx_v_C, PyObject *__pyx_v_gram, PyObject *__pyx_v_p, PyObject *__pyx_v_assume_matrix, PyObject *__pyx_v_min_num_samples, PyObject *__pyx_v_max_num_samples, PyObject *__pyx_v_error_atol, PyObject *__pyx_v_error_rtol, PyObject *__pyx_v_confidence_level, PyObject *__pyx_v_outlier_significance_level, PyObject *__pyx_v_solver_tol, PyObject *__pyx_v_orthogonalize, PyObject *__pyx_v_num_threads);
2985 static PyObject *__pyx_pf_5imate_8traceinv_18_hutchinson_method_4_hutchinson_method_double(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_B, PyObject *__pyx_v_C, PyObject *__pyx_v_gram, PyObject *__pyx_v_p, PyObject *__pyx_v_assume_matrix, PyObject *__pyx_v_min_num_samples, PyObject *__pyx_v_max_num_samples, PyObject *__pyx_v_error_atol, PyObject *__pyx_v_error_rtol, PyObject *__pyx_v_confidence_level, PyObject *__pyx_v_outlier_significance_level, PyObject *__pyx_v_solver_tol, PyObject *__pyx_v_orthogonalize, PyObject *__pyx_v_num_threads);
2986 static PyObject *__pyx_pf_5imate_8traceinv_18_hutchinson_method_6_operator_dot(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_AtA, PyObject *__pyx_v_p, PyObject *__pyx_v_gram, PyObject *__pyx_v_assume_matrix, PyObject *__pyx_v_solver_tol, PyObject *__pyx_v_B, PyObject *__pyx_v_E);
2987 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(
struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, PyObject *__pyx_v_format, PyObject *__pyx_v_mode,
int __pyx_v_allocate_buffer);
2988 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(
struct __pyx_array_obj *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags);
2989 static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(
struct __pyx_array_obj *__pyx_v_self);
2990 static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(
struct __pyx_array_obj *__pyx_v_self);
2991 static Py_ssize_t __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(
struct __pyx_array_obj *__pyx_v_self);
2992 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(
struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr);
2993 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(
struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item);
2994 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_12__setitem__(
struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value);
2995 static PyObject *__pyx_pf___pyx_array___reduce_cython__(CYTHON_UNUSED
struct __pyx_array_obj *__pyx_v_self);
2996 static PyObject *__pyx_pf___pyx_array_2__setstate_cython__(CYTHON_UNUSED
struct __pyx_array_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state);
2997 static int __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(
struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v_name);
2998 static PyObject *__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(
struct __pyx_MemviewEnum_obj *__pyx_v_self);
2999 static PyObject *__pyx_pf___pyx_MemviewEnum___reduce_cython__(
struct __pyx_MemviewEnum_obj *__pyx_v_self);
3000 static PyObject *__pyx_pf___pyx_MemviewEnum_2__setstate_cython__(
struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v___pyx_state);
3001 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit__(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj,
int __pyx_v_flags,
int __pyx_v_dtype_is_object);
3002 static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(
struct __pyx_memoryview_obj *__pyx_v_self);
3003 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index);
3004 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value);
3005 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(
struct __pyx_memoryview_obj *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags);
3006 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
3007 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
3008 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
3009 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
3010 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
3011 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
3012 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
3013 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
3014 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
3015 static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(
struct __pyx_memoryview_obj *__pyx_v_self);
3016 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(
struct __pyx_memoryview_obj *__pyx_v_self);
3017 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(
struct __pyx_memoryview_obj *__pyx_v_self);
3018 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(
struct __pyx_memoryview_obj *__pyx_v_self);
3019 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(
struct __pyx_memoryview_obj *__pyx_v_self);
3020 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(
struct __pyx_memoryview_obj *__pyx_v_self);
3021 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(
struct __pyx_memoryview_obj *__pyx_v_self);
3022 static PyObject *__pyx_pf___pyx_memoryview___reduce_cython__(CYTHON_UNUSED
struct __pyx_memoryview_obj *__pyx_v_self);
3023 static PyObject *__pyx_pf___pyx_memoryview_2__setstate_cython__(CYTHON_UNUSED
struct __pyx_memoryview_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state);
3024 static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(
struct __pyx_memoryviewslice_obj *__pyx_v_self);
3025 static PyObject *__pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(
struct __pyx_memoryviewslice_obj *__pyx_v_self);
3026 static PyObject *__pyx_pf___pyx_memoryviewslice___reduce_cython__(CYTHON_UNUSED
struct __pyx_memoryviewslice_obj *__pyx_v_self);
3027 static PyObject *__pyx_pf___pyx_memoryviewslice_2__setstate_cython__(CYTHON_UNUSED
struct __pyx_memoryviewslice_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state);
3028 static PyObject *__pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type,
long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state);
3029 static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k);
3030 static PyObject *__pyx_tp_new_Enum(PyTypeObject *t, PyObject *a, PyObject *k);
3031 static PyObject *__pyx_tp_new_memoryview(PyTypeObject *t, PyObject *a, PyObject *k);
3032 static PyObject *__pyx_tp_new__memoryviewslice(PyTypeObject *t, PyObject *a, PyObject *k);
3033 static PyObject *__pyx_float_0_95;
3034 static PyObject *__pyx_float_1eneg_2;
3035 static PyObject *__pyx_float_1eneg_6;
3036 static PyObject *__pyx_float_0_001;
3037 static PyObject *__pyx_int_0;
3038 static PyObject *__pyx_int_1;
3039 static PyObject *__pyx_int_10;
3040 static PyObject *__pyx_int_50;
3041 static PyObject *__pyx_int_112105877;
3042 static PyObject *__pyx_int_136983863;
3043 static PyObject *__pyx_int_184977713;
3044 static PyObject *__pyx_int_neg_1;
3045 static PyObject *__pyx_codeobj_;
3046 static PyObject *__pyx_slice__4;
3047 static PyObject *__pyx_tuple__2;
3048 static PyObject *__pyx_tuple__6;
3049 static PyObject *__pyx_tuple__8;
3050 static PyObject *__pyx_tuple__9;
3051 static PyObject *__pyx_tuple__10;
3052 static PyObject *__pyx_tuple__11;
3053 static PyObject *__pyx_tuple__12;
3054 static PyObject *__pyx_tuple__13;
3055 static PyObject *__pyx_tuple__14;
3056 static PyObject *__pyx_tuple__15;
3057 static PyObject *__pyx_tuple__16;
3058 static PyObject *__pyx_tuple__17;
3059 static PyObject *__pyx_tuple__18;
3060 static PyObject *__pyx_tuple__19;
3061 static PyObject *__pyx_tuple__20;
3062 static PyObject *__pyx_tuple__21;
3063 static PyObject *__pyx_tuple__22;
3064 static PyObject *__pyx_tuple__23;
3065 static PyObject *__pyx_tuple__24;
3066 static PyObject *__pyx_tuple__26;
3067 static PyObject *__pyx_tuple__27;
3068 static PyObject *__pyx_tuple__28;
3069 static PyObject *__pyx_tuple__29;
3070 static PyObject *__pyx_tuple__30;
3071 static PyObject *__pyx_tuple__31;
3072 static PyObject *__pyx_tuple__32;
3073 static PyObject *__pyx_tuple__33;
3074 static PyObject *__pyx_tuple__34;
3075 static PyObject *__pyx_tuple__35;
3076 static PyObject *__pyx_tuple__36;
3077 static PyObject *__pyx_tuple__37;
3078 static PyObject *__pyx_codeobj__3;
3079 static PyObject *__pyx_codeobj__5;
3080 static PyObject *__pyx_codeobj__7;
3081 static PyObject *__pyx_codeobj__25;
3093 static PyObject *__pyx_pw_5imate_8traceinv_18_hutchinson_method_1hutchinson_method(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
3094 static char __pyx_doc_5imate_8traceinv_18_hutchinson_method_hutchinson_method[] =
"hutchinson_method(A, gram=False, p=1, return_info=False, B=None, C=None, assume_matrix=u'gen', min_num_samples=10, max_num_samples=50, error_atol=None, error_rtol=1e-2, confidence_level=0.95, outlier_significance_level=0.001, solver_tol=1e-6, orthogonalize=True, num_threads=0, verbose=False, plot=False)\n\n Trace of matrix or linear operator using stochastic Lanczos quadrature\n method.\n\n If `C` is `None`, given the matrices :math:`\\mathbf{A}` and\n :math:`\\mathbf{B}` and the integer exponent :math:`p`, the following is\n computed:\n\n .. math::\n\n \\mathrm{trace} \\left(\\mathbf{B} \\mathbf{A}^{-p} \\right).\n\n If `B` is `None`, it is assumed that :math:`\\mathbf{B}` is the identity\n matrix.\n\n If `C` is not `None`, given the matrix :math:`\\mathbf{C}`, the following\n is instead computed:\n\n .. math::\n\n \\mathrm{trace} \\left(\\mathbf{B} \\mathbf{A}^{-p} \\mathbf{C}\n \\mathbf{A}^{-p} \\right).\n\n If ``gram`` is `True`, then :math:`\\mathbf{A}` in the above is replaced by\n the Gramian matrix :math:`\\mathbf{A}^{\\intercal} \\mathbf{A}`. Namely, if\n `C` is `None`:\n\n .. math::\n\n \\mathrm{trace} \\left(\\mathbf{B}\n (\\mathbf{A}^{\\intercal}\\mathbf{A})^{-p} \\right),\n\n and if `C` is not `None`,\n\n .. math::\n\n \\mathrm{trace} \\left(\\mathbf{B}\n (\\mathbf{A}^{\\intercal}\\mathbf{A})^{-p} \\mathbf{C}\n (\\mathbf{A}^{\\intercal}\\mathbf{A})^{-p} \\right).\n\n Parameters\n ----------\n\n A : numpy.ndarray, scipy.sparse\n A sparse or dense matrix. If ``gram`` is `True`, the matrix can be\n non-square.\n\n .. note::\n\n In the Hutchinson method, the matrix cannot be a type of\n :class:`Matrix` or :class:`imate.AffineMatrixFunction` classes.\n\n gram : bool, default=False\n If `True`, the trace of the Gramian matrix,\n :math:`(\\mathbf{A}^{\\intercal}\\mathbf{A})^p`, is comput""ed. The\n Gramian matrix itself is not directly computed. If `False`, the\n trace of :math:`\\mathbf{A}^p` is computed.\n\n p : float, default=1.0\n The integer exponent :math:`p` in :math:`\\mathbf{A}^{-p}`.\n\n return_info : bool, default=False\n If `True`, this function also returns a dictionary containing\n information about the inner computation, such as process time,\n algorithm settings, etc.\n\n B : numpy.ndarray, scipy.sparse\n A sparse or dense matrix. `B` should be the same size and type of `A`.\n if `B` is `None`, it is assumed that `B` is the identity matrix.\n\n C : numpy.ndarray, scipy.sparse\n A sparse or dense matrix. `C` should be the same size and type of `A`.\n\n assume_matrix : str {'gen', 'sym', 'pos', 'sym_pos'}, default: 'gen'\n Type of matrix `A`:\n\n * ``gen`` assumes `A` is a generic matrix.\n * ``sym`` assumes `A` is symmetric.\n * ``pos`` assumes `A` is positive-definite.\n * ``sym_pos`` assumes `A` is symmetric and positive-definite.\n\n min_num_samples : int, default=10\n The minimum number of Monte-Carlo samples. If the convergence criterion\n is reached before finishing the minimum number of iterations, the\n iterations are forced to continue till the minimum number of iterations\n is finished. This value should be smaller than\n ``maximum_num_samples``.\n\n max_num_samples : int, default=50\n The maximum number of Monte-Carlo samples. If the convergence criterion\n is not reached by the maximum number of iterations, the iterations are\n forced to stop. This value should be larger than\n ``minimum_num_samples``.\n\n error_atol : float, default=None\n Tolerance of the absolute error of convergence of the output. Once the\n error of convergence reaches ``error_atol + error_rtol * output``, the\n iteration is terminated. If the conver""gence criterion is not met by the\n tolerance, then the iterations continue till reaching\n ``max_num_samples`` iterations. If `None`, the termination criterion\n does not depend on this parameter.\n\n error_rtol : float, default=None\n Tolerance of the relative error of convergence of the output. Once the\n error of convergence reaches ``error_atol + error_rtol * output``, the\n iteration is terminated. If the convergence criterion is not met by the\n tolerance, then the iterations continue till reaching\n ``max_num_samples`` iterations. If `None`, the termination criterion\n does not depend on this parameter.\n\n confidence_level : float, default=0.95\n Confidence level of error, which is a number between `0` and `1`. The\n error of convergence of the population of samples is defined by their\n standard deviation times the Z-score, which depends on the confidence\n level. See notes below for details.\n\n outlier_significance_level : float, default=0.001\n One minus the confidence level of the uncertainty of the outliers of\n the output samples. This is a number between `0` and `1`.\n\n solver_tol : float, default=1e-6\n Tolerance of solving linear system.\n\n orthogonalize : int, default=0\n If `True`, it orthogonalizes the set of random vectors used for\n Monte-Carlo sampling. This might lead to a better estimation of the\n output.\n\n num_threads : int, default=0\n Number of processor threads to employ for parallel computation on CPU.\n If set to `0` or a number larger than the available number of threads,\n all threads of the processor are used. The parallelization is performed\n over the Monte-Carlo iterations.\n\n verbose : bool, default=False\n Prints extra information about the computations.\n\n plot : bool, default=False\n Plots convergence of samples. For this"", the packages `matplotlib` and\n `seaborn` should be installed. If no display is available (such as\n running this code on remote machines), the plots are saved as an `SVG`\n file in the current directory.\n\n Returns\n -------\n\n traceinv : float or numpy.array\n Trace of inverse of matrix.\n\n info : dict\n (Only if ``return_info`` is `True`) A dictionary of information with\n the following.\n\n * ``matrix``:\n * ``data_type``: `str`, {`float32`, `float64`, `float128`}. Type of\n the matrix data.\n * ``gram``: `bool`, whether the matrix `A` or its Gramian is\n considered.\n * ``exponent``: `float`, the exponent `p` in :math:`\\mathbf{A}^p`.\n * ``assume_matrix``: `str`, {`gen`, `sym`, `pos`, `sym_pos`},\n determines the type of matrix `A`.\n * ``size``: (int, int) The size of matrix `A`.\n * ``sparse``: `bool`, whether the matrix `A` is sparse or dense.\n * ``nnz``: `int`, if `A` is sparse, the number of non-zero elements\n of `A`.\n * ``density``: `float`, if `A` is sparse, the density of `A`, which\n is the `nnz` divided by size squared.\n * ``num_inquiries``: `int`, the size of inquiries of each parameter\n of the linear operator `A`. If `A` is a matrix, this is always\n `1`. If `A` is a type of :class:`AffineMatrixFunction`, this\n value is the number of :math:`t_i` parameters.\n\n * ``convergence``:\n * ``converged``: `bool`, whether the Monte-Carlo sampling\n converged.\n * ``min_num_samples``: `int`, the minimum number of Monte-Carlo\n iterations.\n * ``max_num_samples``: `int`, the maximum number of Monte-Carlo\n iterations.\n * ``num_outliers``: `int`, number of outliers found during search\n ""for outliers among the array of output.\n * ``num_samples_used``: `int`, number of Monte-Carlo samples used\n to produce the output. This is the total number of iterations\n minus the number of outliers.\n * ``samples``: `array` [`float`], an array of the size\n `max_num_samples`. The first few entries (`num_samples_used`) of\n this array are the output results of the Monte-Carlo sampling.\n The average of these samples is the final result. The rest of\n this array is `nan`.\n * ``samples_mean``: `float`, mean of the `samples` array, excluding\n the `nan` values.\n * ``samples_processed_order``: `array` [`int`], in parallel\n processing, samples are processed in non-sequential order. This\n array, which has the same size as `samples`, keeps track of the\n order in which each sample is processed.\n\n * ``error``:\n * ``absolute_error``: `float`, the absolute error of the\n convergence of samples.\n * ``confidence_level``: `float`, the confidence level used to\n calculate the error from standard deviation of samples.\n * ``error_atol``: `float`, the tolerance of absolute error of the\n convergence of samples.\n * ``error_rtol``: `float`, the tolerance of relative error of the\n convergence of samples.\n * ``outlier_significance_level``: `float`, the significance level\n used to determine the outliers in samples.\n * ``relative_error``: `float`, the relative error of the\n convergence of samples.\n\n * ``device``:\n * ``num_cpu_threads``: `int`, number of CPU threads used in shared\n memory parallel processing.\n * ``num_gpu_devices``: `int`, number of GPU devices used in the\n multi-GPU (GPU far""m) computation.\n * ``num_gpu_multiprocessors``: `int`, number of GPU\n multi-processors.\n * ``num_gpu_threads_per_multiprocessor``: `int`, number of GPU\n threads on each GPU multi-processor.\n\n * ``time``:\n * ``tot_wall_time``: `float`, total elapsed time of computation.\n * ``alg_wall_time``: `float`, elapsed time of computation during\n only the algorithm execution.\n * ``cpu_proc_time``: `float`, the CPU processing time of\n computation.\n\n * ``solver``:\n * ``version``: `str`, version of imate.\n * ``method``: 'hutchinson'.\n * ``solver_tol``: `float`, tolerance of solving linear system.\n * ``orthogonalize``: `bool`, orthogonalization flag.\n\n Raises\n ------\n\n ImportError\n If the package has not been compiled with GPU support, but ``gpu`` is\n set to `True`. To resolve the issue, set ``gpu`` to `False` to be able\n to use the existing installation. Alternatively, export the\n environment variable ``USE_CUDA=1`` and recompile the source code of\n the package.\n\n See Also\n --------\n\n imate.logdet\n imate.trace\n imate.schatten\n\n Notes\n -----\n\n **Computational Complexity:**\n\n This method uses the Hutchinson, which is a randomized algorithm. The\n computational complexity of this method is\n\n .. math::\n\n \\mathcal{O}((\\rho n^2s),\n\n where :math:`n` is the matrix size, :math:`\\rho` is the density of\n sparse matrix (for dense matrix, :math:`\\rho=1`), and :math:`s` is the\n number of samples (set with ``min_num_samples`` and ``max_num_samples``).\n\n This method can be used on very large matrices (:math:`n > 2^{12}`). The\n solution is an approximation.\n\n **Convergence criterion:**\n\n Let :math:`n_{\\min}` and :math:`n_{\\max}` be the minimum and maximum\n number of ""iterations respectively defined by ``min_num_samples`` and\n ``max_num_samples``. The iterations terminate at\n :math:`n_{\\min} \\leq i \\leq n_{\\max}` where :math:`i` is the\n iteration counter. The iterations stop earlier at :math:`i < n_{\\max}` if\n the convergence error of the mean of the samples is satisfied, as follows.\n\n Suppose :math:`s(j)` and :math:`\\sigma(i)` are respectively the mean and\n standard deviation of samples after :math:`j` iterations. The error of\n convergence, :math:`e(j)`, is defined by\n\n .. math::\n\n e(j) = \\frac{\\sigma(j)}{\\sqrt{j}} Z\n\n where :math:`Z` is the Z-score defined by\n\n .. math::\n\n Z = \\sqrt{2} \\mathrm{erf}^{-1}(\\phi).\n\n In the above, :math:`\\phi` is the confidence level and set by\n ``confidence_level`` argument, and :math:`\\mathrm{erf}^{-1}` is the\n inverse error function. A confidence level of 95%, for instance, means that\n the Z-score is 1.96, which means the confidence interval is\n :math:`\\pm 1.96 \\sigma`.\n\n The termination criterion is\n\n .. math::\n\n e(j) < \\epsilon_a + s(j) \\epsilon_r,\n\n where :math:`\\epsilon_{a}` and :math:`\\epsilon_r` are the absolute and\n relative error tolerances respectively, and they are set by ``error_atol``\n and ``error_rtol``.\n\n **Plotting:**\n\n If ``plot`` is set to `True`, it plots the convergence of samples and their\n relative error.\n\n * If no graphical backend exists (such as running the code on a remote\n server or manually disabling the X11 backend), the plot will not be\n shown, rather, it will be saved as an ``svg`` file in the current\n directory.\n * If the executable ``latex`` is available on ``PATH``, the plot is\n rendered using :math:`\\rm\\LaTeX` and it may take slightly longer to\n produce the plot.\n * If :math:`\\rm\\LaTeX` is not installed, it uses any available San-Serif\n font to render the plot.""\n\n To manually disable interactive plot display and save the plot as\n ``svg`` instead, add the following at the very beginning of your code\n before importing :mod:`imate`:\n\n .. code-block:: python\n\n >>> import os\n >>> os.environ['IMATE_NO_DISPLAY'] = 'True'\n\n References\n ----------\n\n * `Ubaru, S., Chen, J., and Saad, Y. (2017)\n <https://www-users.cs.umn.edu/~saad/PDF/ys-2016-04.pdf>`_,\n Fast Estimation of :math:`\\mathrm{tr}(F(A))` Via Stochastic Lanczos\n Quadrature, SIAM J. Matrix Anal. Appl., 38(4), 1075-1099.\n\n Examples\n --------\n\n **Basic Usage:**\n\n Compute the trace of :math:`\\mathbf{A}^{-2}`:\n\n .. code-block:: python\n\n >>> # Import packages\n >>> from imate import toeplitz, traceinv\n\n >>> # Generate a sample matrix\n >>> A = toeplitz(2, 1, size=100)\n\n >>> # Compute trace of inverse\n >>> traceinv(A, p=2, method='hutchinson')\n 24.73726368966402\n\n Compute the trace of :math:`(\\mathbf{A}^{\\intercal} \\mathbf{A})^{-2}`:\n\n .. code-block:: python\n\n >>> # Using Gramian matrix of A\n >>> traceinv(A, gram=True, p=2, method='hutchinson')\n 17.751659383784748\n\n Compute the trace of :math:`\\mathbf{B} \\mathbf{A}^{-2}`:\n\n .. code-block:: python\n\n >>> # Generate another sample matrix\n >>> B = toeplitz(4, 3, size=100)\n\n >>> # Using Gramian matrix of A\n >>> traceinv(A, p=2, method='hutchinson', B=B)\n 99.8817360381704\n\n Compute the trace of :math:`\\mathbf{B} \\mathbf{A}^{-2} \\mathbf{C}\n \\mathbf{A}^{-2}`:\n\n .. code-block:: python\n\n >>> # Generate another sample matrix\n >>> C = toeplitz(5, 4, size=100)\n\n >>> # Using Gramian matrix of A\n >>> traceinv(A, p=2, method='hutchinson', B=B, C=C)\n 124.45436379980006\n\n Compute the trace of :math:`\\mathbf{B} (\\mathbf{A}^{\\intercal}\n ""\\mathbf{A})^{-2} \\mathbf{C} (\\mathbf{A}^{\\intercal} \\mathbf{A})^{-2}`:\n\n .. code-block:: python\n\n >>> # Using Gramian matrix of A\n >>> traceinv(A, gram=True, p=2, method='hutchinson', B=B, C=C)\n 5.517453125230929\n\n **Verbose output:**\n\n By setting ``verbose`` to `True`, useful info about the process is\n printed.\n\n .. literalinclude:: ../_static/data/imate.traceinv.hutchinson-verbose.txt\n :language: python\n\n **Output information:**\n\n Print information about the inner computation:\n\n .. code-block:: python\n\n >>> ti, info = traceinv(A, method='hutchinson', return_info=True)\n >>> print(ti)\n 50.059307947603585\n\n >>> # Print dictionary neatly using pprint\n >>> from pprint import pprint\n >>> pprint(info)\n {\n 'matrix': {\n 'assume_matrix': 'gen',\n 'data_type': b'float64',\n 'density': 0.0199,\n 'exponent': 1,\n 'gram': False,\n 'nnz': 199,\n 'num_inquiries': 1,\n 'size': (100, 100),\n 'sparse': True\n },\n 'convergence': {\n 'converged': False,\n 'max_num_samples': 50,\n 'min_num_samples': 10,\n 'num_outliers': 0,\n 'num_samples_used': 50,\n 'samples': array([52.237154, ..., 51.37932704]),\n 'samples_mean': 50.059307947603585,\n 'samples_processed_order': array([ 0, ..., 49])\n },\n 'error': {\n 'absolute_error': 0.8111131801161796,\n 'confidence_level': 0.95,\n 'error_atol': 0.0,\n 'error_rtol': 0.01,\n 'outlier_significance_level': 0.001,\n 'relative_error': 0.016203044216375525\n },\n 'solver': {\n 'method'"": 'hutchinson',\n 'orthogonalize': True,\n 'solver_tol': 1e-06,\n 'version': '0.16.0'\n },\n 'device': {\n 'num_cpu_threads': 8,\n 'num_gpu_devices': 0,\n 'num_gpu_multiprocessors': 0,\n 'num_gpu_threads_per_multiprocessor': 0\n },\n 'time': {\n 'alg_wall_time': 0.03236744087189436,\n 'cpu_proc_time': 0.047695197999999994,\n 'tot_wall_time': 0.033352302853018045\n }\n }\n\n **Large matrix:**\n\n Compute the trace of :math:`\\mathbf{A}^{-1}` for a very large sparse\n matrix using at least `100` samples.\n\n .. code-block:: python\n :emphasize-lines: 5, 6, 7\n\n >>> # Create a symmetric positive-definite matrix of size one million.\n >>> A = toeplitz(2, 1, size=1000000, gram=True)\n\n >>> # Approximate trace using hutchinson method\n >>> ti, info = traceinv(A, method='hutchinson', solver_tol=1e-4,\n ... assume_matrix='sym_pos', min_num_samples=100,\n ... max_num_samples=200, return_info=True)\n >>> print(ti)\n 333292.3226031165\n\n >>> # Find the time it took to compute the above\n >>> print(info['time'])\n {\n 'tot_wall_time': 175.93423152901232,\n 'alg_wall_time': 119.86316476506181,\n 'cpu_proc_time': 572.180877451\n }\n\n Compare the result of the above approximation with the exact solution of\n the trace using the analytic relation for Toeplitz matrix. See\n :func:`imate.sample_matrices.toeplitz_traceinv` for details.\n\n .. code-block:: python\n\n >>> from imate.sample_matrices import toeplitz_traceinv\n >>> toeplitz_traceinv(2, 1, size=1000000, gram=True)\n 333333.2222222222\n\n It can be seen that the error of approximation is :math:`0.012 \\%`. Th""is\n accuracy is remarkable considering that the computation on such a large\n matrix took on 119 seconds. Computing the trace of such a large matrix\n using any of the exact methods (such as ``exact`` or ``eigenvalue``) is\n infeasible.\n\n **Plotting:**\n\n By setting ``plot`` to `True`, plots of samples during Monte-Carlo\n iterations and the convergence of their mean are generated.\n\n .. code-block:: python\n\n >>> A = toeplitz(2, 1, size=1000000, gram=True)\n >>> traceinv(A, method='hutchinson', assume_matrix='sym_pos',\n ... solver_tol=1e-4, min_num_samples=50, max_num_samples=150,\n ... error_rtol=2e-4, confidence_level=0.95,\n ... outlier_significance_level=0.001, plot=True)\n\n .. image:: ../_static/images/plots/traceinv_hutchinson_convergence.png\n :align: center\n :class: custom-dark\n\n In the left plot, the samples are shown in circles and the cumulative mean\n of the samples is shown by a solid black curve. The shaded area corresponds\n to the 95% confidence interval :math:`\\pm 1.96 \\sigma`, which is set by\n ``confidence_level=0.95``. The samples outside the interval of 99.9% are\n considered outliers, which is set by the significance level\n ``outlier_significance_level=0.001``.\n\n In the right plot, the darker shaded area in the interval :math:`[0, 50]`\n shows the minimum number of samples and is set by ``min_num_samples=50``.\n The iterations do not stop till the minimum number of iterations is passed.\n We can observe that sampling is terminated after 140 iterations where the\n relative error of samples reaches 0.02% since we set ``error_rtol=2e-4``.\n The lighter shaded area in the interval :math:`[140, 150]` corresponds to\n the iterations that were not performed to reach the specified maximum\n iterations by ``max_num_samples=150``.\n ";
3095 static PyMethodDef __pyx_mdef_5imate_8traceinv_18_hutchinson_method_1hutchinson_method = {
"hutchinson_method", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_5imate_8traceinv_18_hutchinson_method_1hutchinson_method, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5imate_8traceinv_18_hutchinson_method_hutchinson_method};
3096 static PyObject *__pyx_pw_5imate_8traceinv_18_hutchinson_method_1hutchinson_method(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
3097 PyObject *__pyx_v_A = 0;
3098 PyObject *__pyx_v_gram = 0;
3099 PyObject *__pyx_v_p = 0;
3100 PyObject *__pyx_v_return_info = 0;
3101 PyObject *__pyx_v_B = 0;
3102 PyObject *__pyx_v_C = 0;
3103 PyObject *__pyx_v_assume_matrix = 0;
3104 PyObject *__pyx_v_min_num_samples = 0;
3105 PyObject *__pyx_v_max_num_samples = 0;
3106 PyObject *__pyx_v_error_atol = 0;
3107 PyObject *__pyx_v_error_rtol = 0;
3108 PyObject *__pyx_v_confidence_level = 0;
3109 PyObject *__pyx_v_outlier_significance_level = 0;
3110 PyObject *__pyx_v_solver_tol = 0;
3111 PyObject *__pyx_v_orthogonalize = 0;
3112 PyObject *__pyx_v_num_threads = 0;
3113 PyObject *__pyx_v_verbose = 0;
3114 PyObject *__pyx_v_plot = 0;
3115 int __pyx_lineno = 0;
3116 const char *__pyx_filename = NULL;
3117 int __pyx_clineno = 0;
3118 PyObject *__pyx_r = 0;
3119 __Pyx_RefNannyDeclarations
3120 __Pyx_RefNannySetupContext(
"hutchinson_method (wrapper)", 0);
3122 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_A,&__pyx_n_s_gram,&__pyx_n_s_p,&__pyx_n_s_return_info,&__pyx_n_s_B,&__pyx_n_s_C,&__pyx_n_s_assume_matrix,&__pyx_n_s_min_num_samples,&__pyx_n_s_max_num_samples,&__pyx_n_s_error_atol,&__pyx_n_s_error_rtol,&__pyx_n_s_confidence_level,&__pyx_n_s_outlier_significance_level,&__pyx_n_s_solver_tol,&__pyx_n_s_orthogonalize,&__pyx_n_s_num_threads,&__pyx_n_s_verbose,&__pyx_n_s_plot,0};
3123 PyObject* values[18] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
3132 values[1] = ((PyObject *)((PyObject *)Py_False));
3133 values[2] = ((PyObject *)((PyObject *)__pyx_int_1));
3142 values[3] = ((PyObject *)((PyObject *)Py_False));
3151 values[4] = ((PyObject *)((PyObject *)Py_None));
3160 values[5] = ((PyObject *)((PyObject *)Py_None));
3161 values[6] = ((PyObject *)((PyObject*)__pyx_n_u_gen));
3162 values[7] = ((PyObject *)((PyObject *)__pyx_int_10));
3163 values[8] = ((PyObject *)((PyObject *)__pyx_int_50));
3172 values[9] = ((PyObject *)((PyObject *)Py_None));
3173 values[10] = ((PyObject *)((PyObject*)__pyx_float_1eneg_2));
3174 values[11] = ((PyObject *)((PyObject*)__pyx_float_0_95));
3175 values[12] = ((PyObject *)((PyObject*)__pyx_float_0_001));
3176 values[13] = ((PyObject *)((PyObject*)__pyx_float_1eneg_6));
3185 values[14] = ((PyObject *)((PyObject *)Py_True));
3186 values[15] = ((PyObject *)((PyObject *)__pyx_int_0));
3195 values[16] = ((PyObject *)((PyObject *)Py_False));
3204 values[17] = ((PyObject *)((PyObject *)Py_False));
3205 if (unlikely(__pyx_kwds)) {
3207 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
3209 case 18: values[17] = PyTuple_GET_ITEM(__pyx_args, 17);
3211 case 17: values[16] = PyTuple_GET_ITEM(__pyx_args, 16);
3213 case 16: values[15] = PyTuple_GET_ITEM(__pyx_args, 15);
3215 case 15: values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
3217 case 14: values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
3219 case 13: values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
3221 case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
3223 case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
3225 case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
3227 case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
3229 case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
3231 case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
3233 case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
3235 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
3237 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
3239 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3241 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3243 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3246 default:
goto __pyx_L5_argtuple_error;
3248 kw_args = PyDict_Size(__pyx_kwds);
3251 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_A)) != 0)) kw_args--;
3252 else goto __pyx_L5_argtuple_error;
3256 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_gram);
3257 if (value) { values[1] = value; kw_args--; }
3262 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_p);
3263 if (value) { values[2] = value; kw_args--; }
3268 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_return_info);
3269 if (value) { values[3] = value; kw_args--; }
3274 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_B);
3275 if (value) { values[4] = value; kw_args--; }
3280 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_C);
3281 if (value) { values[5] = value; kw_args--; }
3286 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_assume_matrix);
3287 if (value) { values[6] = value; kw_args--; }
3292 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_min_num_samples);
3293 if (value) { values[7] = value; kw_args--; }
3298 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_max_num_samples);
3299 if (value) { values[8] = value; kw_args--; }
3304 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_error_atol);
3305 if (value) { values[9] = value; kw_args--; }
3310 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_error_rtol);
3311 if (value) { values[10] = value; kw_args--; }
3316 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_confidence_level);
3317 if (value) { values[11] = value; kw_args--; }
3322 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_outlier_significance_level);
3323 if (value) { values[12] = value; kw_args--; }
3328 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_solver_tol);
3329 if (value) { values[13] = value; kw_args--; }
3334 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_orthogonalize);
3335 if (value) { values[14] = value; kw_args--; }
3340 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_num_threads);
3341 if (value) { values[15] = value; kw_args--; }
3346 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_verbose);
3347 if (value) { values[16] = value; kw_args--; }
3352 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_plot);
3353 if (value) { values[17] = value; kw_args--; }
3356 if (unlikely(kw_args > 0)) {
3357 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"hutchinson_method") < 0)) __PYX_ERR(0, 37, __pyx_L3_error)
3360 switch (PyTuple_GET_SIZE(__pyx_args)) {
3361 case 18: values[17] = PyTuple_GET_ITEM(__pyx_args, 17);
3363 case 17: values[16] = PyTuple_GET_ITEM(__pyx_args, 16);
3365 case 16: values[15] = PyTuple_GET_ITEM(__pyx_args, 15);
3367 case 15: values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
3369 case 14: values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
3371 case 13: values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
3373 case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
3375 case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
3377 case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
3379 case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
3381 case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
3383 case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
3385 case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
3387 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
3389 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
3391 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3393 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3395 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3397 default:
goto __pyx_L5_argtuple_error;
3400 __pyx_v_A = values[0];
3401 __pyx_v_gram = values[1];
3402 __pyx_v_p = values[2];
3403 __pyx_v_return_info = values[3];
3404 __pyx_v_B = values[4];
3405 __pyx_v_C = values[5];
3406 __pyx_v_assume_matrix = values[6];
3407 __pyx_v_min_num_samples = values[7];
3408 __pyx_v_max_num_samples = values[8];
3409 __pyx_v_error_atol = values[9];
3410 __pyx_v_error_rtol = values[10];
3411 __pyx_v_confidence_level = values[11];
3412 __pyx_v_outlier_significance_level = values[12];
3413 __pyx_v_solver_tol = values[13];
3414 __pyx_v_orthogonalize = values[14];
3415 __pyx_v_num_threads = values[15];
3416 __pyx_v_verbose = values[16];
3417 __pyx_v_plot = values[17];
3419 goto __pyx_L4_argument_unpacking_done;
3420 __pyx_L5_argtuple_error:;
3421 __Pyx_RaiseArgtupleInvalid(
"hutchinson_method", 0, 1, 18, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 37, __pyx_L3_error)
3423 __Pyx_AddTraceback(
"imate.traceinv._hutchinson_method.hutchinson_method", __pyx_clineno, __pyx_lineno, __pyx_filename);
3424 __Pyx_RefNannyFinishContext();
3426 __pyx_L4_argument_unpacking_done:;
3427 __pyx_r = __pyx_pf_5imate_8traceinv_18_hutchinson_method_hutchinson_method(__pyx_self, __pyx_v_A, __pyx_v_gram, __pyx_v_p, __pyx_v_return_info, __pyx_v_B, __pyx_v_C, __pyx_v_assume_matrix, __pyx_v_min_num_samples, __pyx_v_max_num_samples, __pyx_v_error_atol, __pyx_v_error_rtol, __pyx_v_confidence_level, __pyx_v_outlier_significance_level, __pyx_v_solver_tol, __pyx_v_orthogonalize, __pyx_v_num_threads, __pyx_v_verbose, __pyx_v_plot);
3438 __Pyx_RefNannyFinishContext();
3442 static PyObject *__pyx_pf_5imate_8traceinv_18_hutchinson_method_hutchinson_method(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_gram, PyObject *__pyx_v_p, PyObject *__pyx_v_return_info, PyObject *__pyx_v_B, PyObject *__pyx_v_C, PyObject *__pyx_v_assume_matrix, PyObject *__pyx_v_min_num_samples, PyObject *__pyx_v_max_num_samples, PyObject *__pyx_v_error_atol, PyObject *__pyx_v_error_rtol, PyObject *__pyx_v_confidence_level, PyObject *__pyx_v_outlier_significance_level, PyObject *__pyx_v_solver_tol, PyObject *__pyx_v_orthogonalize, PyObject *__pyx_v_num_threads, PyObject *__pyx_v_verbose, PyObject *__pyx_v_plot) {
3443 CYTHON_UNUSED PyObject *__pyx_v_square = NULL;
3444 PyObject *__pyx_v_data_type_name = NULL;
3445 PyObject *__pyx_v_trace = NULL;
3446 PyObject *__pyx_v_error = NULL;
3447 PyObject *__pyx_v_num_outliers = NULL;
3448 PyObject *__pyx_v_samples = NULL;
3449 PyObject *__pyx_v_processed_samples_indices = NULL;
3450 CYTHON_UNUSED PyObject *__pyx_v_num_processed_samples = NULL;
3451 PyObject *__pyx_v_num_samples_used = NULL;
3452 PyObject *__pyx_v_converged = NULL;
3453 PyObject *__pyx_v_tot_wall_time = NULL;
3454 PyObject *__pyx_v_alg_wall_time = NULL;
3455 PyObject *__pyx_v_cpu_proc_time = NULL;
3456 PyObject *__pyx_v_info = NULL;
3457 PyObject *__pyx_r = NULL;
3458 __Pyx_TraceDeclarations
3459 __Pyx_RefNannyDeclarations
3460 PyObject *__pyx_t_1 = NULL;
3461 PyObject *__pyx_t_2 = NULL;
3462 PyObject *__pyx_t_3 = NULL;
3464 PyObject *__pyx_t_5 = NULL;
3465 PyObject *__pyx_t_6 = NULL;
3466 PyObject *(*__pyx_t_7)(PyObject *);
3468 PyObject *__pyx_t_9 = NULL;
3469 PyObject *__pyx_t_10 = NULL;
3470 PyObject *__pyx_t_11 = NULL;
3471 PyObject *__pyx_t_12 = NULL;
3472 PyObject *__pyx_t_13 = NULL;
3473 PyObject *__pyx_t_14 = NULL;
3474 PyObject *__pyx_t_15 = NULL;
3475 PyObject *__pyx_t_16 = NULL;
3476 int __pyx_lineno = 0;
3477 const char *__pyx_filename = NULL;
3478 int __pyx_clineno = 0;
3479 __Pyx_TraceFrameInit(__pyx_codeobj_)
3480 __Pyx_RefNannySetupContext(
"hutchinson_method", 0);
3481 __Pyx_TraceCall(
"hutchinson_method", __pyx_f[0], 37, 0, __PYX_ERR(0, 37, __pyx_L1_error));
3482 __Pyx_INCREF(__pyx_v_min_num_samples);
3483 __Pyx_INCREF(__pyx_v_max_num_samples);
3484 __Pyx_INCREF(__pyx_v_error_atol);
3485 __Pyx_INCREF(__pyx_v_error_rtol);
3486 __Pyx_INCREF(__pyx_v_num_threads);
3495 __Pyx_TraceLine(602,0,__PYX_ERR(0, 602, __pyx_L1_error))
3496 __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_check_arguments);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 602, __pyx_L1_error)
3497 __Pyx_GOTREF(__pyx_t_2);
3506 __Pyx_TraceLine(606,0,__PYX_ERR(0, 606, __pyx_L1_error))
3509 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
3510 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
3511 if (likely(__pyx_t_3)) {
3512 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_2);
3513 __Pyx_INCREF(__pyx_t_3);
3514 __Pyx_INCREF(
function);
3515 __Pyx_DECREF_SET(__pyx_t_2,
function);
3519 #if CYTHON_FAST_PYCALL
3520 if (PyFunction_Check(__pyx_t_2)) {
3521 PyObject *__pyx_temp[19] = {__pyx_t_3, __pyx_v_A, __pyx_v_B, __pyx_v_C, __pyx_v_gram, __pyx_v_p, __pyx_v_return_info, __pyx_v_assume_matrix, __pyx_v_min_num_samples, __pyx_v_max_num_samples, __pyx_v_error_atol, __pyx_v_error_rtol, __pyx_v_confidence_level, __pyx_v_outlier_significance_level, __pyx_v_solver_tol, __pyx_v_orthogonalize, __pyx_v_num_threads, __pyx_v_verbose, __pyx_v_plot};
3522 __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 18+__pyx_t_4);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 602, __pyx_L1_error)
3523 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
3524 __Pyx_GOTREF(__pyx_t_1);
3527 #if CYTHON_FAST_PYCCALL
3528 if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
3529 PyObject *__pyx_temp[19] = {__pyx_t_3, __pyx_v_A, __pyx_v_B, __pyx_v_C, __pyx_v_gram, __pyx_v_p, __pyx_v_return_info, __pyx_v_assume_matrix, __pyx_v_min_num_samples, __pyx_v_max_num_samples, __pyx_v_error_atol, __pyx_v_error_rtol, __pyx_v_confidence_level, __pyx_v_outlier_significance_level, __pyx_v_solver_tol, __pyx_v_orthogonalize, __pyx_v_num_threads, __pyx_v_verbose, __pyx_v_plot};
3530 __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 18+__pyx_t_4);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 602, __pyx_L1_error)
3531 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
3532 __Pyx_GOTREF(__pyx_t_1);
3536 __pyx_t_5 = PyTuple_New(18+__pyx_t_4);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 602, __pyx_L1_error)
3537 __Pyx_GOTREF(__pyx_t_5);
3539 __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL;
3541 __Pyx_INCREF(__pyx_v_A);
3542 __Pyx_GIVEREF(__pyx_v_A);
3543 PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_v_A);
3544 __Pyx_INCREF(__pyx_v_B);
3545 __Pyx_GIVEREF(__pyx_v_B);
3546 PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_v_B);
3547 __Pyx_INCREF(__pyx_v_C);
3548 __Pyx_GIVEREF(__pyx_v_C);
3549 PyTuple_SET_ITEM(__pyx_t_5, 2+__pyx_t_4, __pyx_v_C);
3550 __Pyx_INCREF(__pyx_v_gram);
3551 __Pyx_GIVEREF(__pyx_v_gram);
3552 PyTuple_SET_ITEM(__pyx_t_5, 3+__pyx_t_4, __pyx_v_gram);
3553 __Pyx_INCREF(__pyx_v_p);
3554 __Pyx_GIVEREF(__pyx_v_p);
3555 PyTuple_SET_ITEM(__pyx_t_5, 4+__pyx_t_4, __pyx_v_p);
3556 __Pyx_INCREF(__pyx_v_return_info);
3557 __Pyx_GIVEREF(__pyx_v_return_info);
3558 PyTuple_SET_ITEM(__pyx_t_5, 5+__pyx_t_4, __pyx_v_return_info);
3559 __Pyx_INCREF(__pyx_v_assume_matrix);
3560 __Pyx_GIVEREF(__pyx_v_assume_matrix);
3561 PyTuple_SET_ITEM(__pyx_t_5, 6+__pyx_t_4, __pyx_v_assume_matrix);
3562 __Pyx_INCREF(__pyx_v_min_num_samples);
3563 __Pyx_GIVEREF(__pyx_v_min_num_samples);
3564 PyTuple_SET_ITEM(__pyx_t_5, 7+__pyx_t_4, __pyx_v_min_num_samples);
3565 __Pyx_INCREF(__pyx_v_max_num_samples);
3566 __Pyx_GIVEREF(__pyx_v_max_num_samples);
3567 PyTuple_SET_ITEM(__pyx_t_5, 8+__pyx_t_4, __pyx_v_max_num_samples);
3568 __Pyx_INCREF(__pyx_v_error_atol);
3569 __Pyx_GIVEREF(__pyx_v_error_atol);
3570 PyTuple_SET_ITEM(__pyx_t_5, 9+__pyx_t_4, __pyx_v_error_atol);
3571 __Pyx_INCREF(__pyx_v_error_rtol);
3572 __Pyx_GIVEREF(__pyx_v_error_rtol);
3573 PyTuple_SET_ITEM(__pyx_t_5, 10+__pyx_t_4, __pyx_v_error_rtol);
3574 __Pyx_INCREF(__pyx_v_confidence_level);
3575 __Pyx_GIVEREF(__pyx_v_confidence_level);
3576 PyTuple_SET_ITEM(__pyx_t_5, 11+__pyx_t_4, __pyx_v_confidence_level);
3577 __Pyx_INCREF(__pyx_v_outlier_significance_level);
3578 __Pyx_GIVEREF(__pyx_v_outlier_significance_level);
3579 PyTuple_SET_ITEM(__pyx_t_5, 12+__pyx_t_4, __pyx_v_outlier_significance_level);
3580 __Pyx_INCREF(__pyx_v_solver_tol);
3581 __Pyx_GIVEREF(__pyx_v_solver_tol);
3582 PyTuple_SET_ITEM(__pyx_t_5, 13+__pyx_t_4, __pyx_v_solver_tol);
3583 __Pyx_INCREF(__pyx_v_orthogonalize);
3584 __Pyx_GIVEREF(__pyx_v_orthogonalize);
3585 PyTuple_SET_ITEM(__pyx_t_5, 14+__pyx_t_4, __pyx_v_orthogonalize);
3586 __Pyx_INCREF(__pyx_v_num_threads);
3587 __Pyx_GIVEREF(__pyx_v_num_threads);
3588 PyTuple_SET_ITEM(__pyx_t_5, 15+__pyx_t_4, __pyx_v_num_threads);
3589 __Pyx_INCREF(__pyx_v_verbose);
3590 __Pyx_GIVEREF(__pyx_v_verbose);
3591 PyTuple_SET_ITEM(__pyx_t_5, 16+__pyx_t_4, __pyx_v_verbose);
3592 __Pyx_INCREF(__pyx_v_plot);
3593 __Pyx_GIVEREF(__pyx_v_plot);
3594 PyTuple_SET_ITEM(__pyx_t_5, 17+__pyx_t_4, __pyx_v_plot);
3595 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 602, __pyx_L1_error)
3596 __Pyx_GOTREF(__pyx_t_1);
3597 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
3599 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3600 if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
3601 PyObject* sequence = __pyx_t_1;
3602 Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
3603 if (unlikely(size != 3)) {
3604 if (size > 3) __Pyx_RaiseTooManyValuesError(3);
3605 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
3606 __PYX_ERR(0, 602, __pyx_L1_error)
3608 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
3609 if (likely(PyTuple_CheckExact(sequence))) {
3610 __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0);
3611 __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1);
3612 __pyx_t_3 = PyTuple_GET_ITEM(sequence, 2);
3614 __pyx_t_2 = PyList_GET_ITEM(sequence, 0);
3615 __pyx_t_5 = PyList_GET_ITEM(sequence, 1);
3616 __pyx_t_3 = PyList_GET_ITEM(sequence, 2);
3618 __Pyx_INCREF(__pyx_t_2);
3619 __Pyx_INCREF(__pyx_t_5);
3620 __Pyx_INCREF(__pyx_t_3);
3622 __pyx_t_2 = PySequence_ITEM(sequence, 0);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 602, __pyx_L1_error)
3623 __Pyx_GOTREF(__pyx_t_2);
3624 __pyx_t_5 = PySequence_ITEM(sequence, 1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 602, __pyx_L1_error)
3625 __Pyx_GOTREF(__pyx_t_5);
3626 __pyx_t_3 = PySequence_ITEM(sequence, 2);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 602, __pyx_L1_error)
3627 __Pyx_GOTREF(__pyx_t_3);
3629 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3631 Py_ssize_t index = -1;
3632 __pyx_t_6 = PyObject_GetIter(__pyx_t_1);
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 602, __pyx_L1_error)
3633 __Pyx_GOTREF(__pyx_t_6);
3634 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3635 __pyx_t_7 = Py_TYPE(__pyx_t_6)->tp_iternext;
3636 index = 0; __pyx_t_2 = __pyx_t_7(__pyx_t_6);
if (unlikely(!__pyx_t_2))
goto __pyx_L3_unpacking_failed;
3637 __Pyx_GOTREF(__pyx_t_2);
3638 index = 1; __pyx_t_5 = __pyx_t_7(__pyx_t_6);
if (unlikely(!__pyx_t_5))
goto __pyx_L3_unpacking_failed;
3639 __Pyx_GOTREF(__pyx_t_5);
3640 index = 2; __pyx_t_3 = __pyx_t_7(__pyx_t_6);
if (unlikely(!__pyx_t_3))
goto __pyx_L3_unpacking_failed;
3641 __Pyx_GOTREF(__pyx_t_3);
3642 if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_6), 3) < 0) __PYX_ERR(0, 602, __pyx_L1_error)
3644 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
3645 goto __pyx_L4_unpacking_done;
3646 __pyx_L3_unpacking_failed:;
3647 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
3649 if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
3650 __PYX_ERR(0, 602, __pyx_L1_error)
3651 __pyx_L4_unpacking_done:;
3661 __Pyx_TraceLine(602,0,__PYX_ERR(0, 602, __pyx_L1_error))
3662 __Pyx_DECREF_SET(__pyx_v_error_atol, __pyx_t_2);
3664 __Pyx_DECREF_SET(__pyx_v_error_rtol, __pyx_t_5);
3666 __pyx_v_square = __pyx_t_3;
3676 __Pyx_TraceLine(611,0,__PYX_ERR(0, 611, __pyx_L1_error))
3677 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_shape);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 611, __pyx_L1_error)
3678 __Pyx_GOTREF(__pyx_t_1);
3679 __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_1, 1,
long, 1, __Pyx_PyInt_From_long, 0, 0, 0);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 611, __pyx_L1_error)
3680 __Pyx_GOTREF(__pyx_t_3);
3681 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3682 __pyx_t_1 = PyObject_RichCompare(__pyx_t_3, __pyx_v_max_num_samples, Py_LT); __Pyx_XGOTREF(__pyx_t_1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 611, __pyx_L1_error)
3683 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3684 __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_1);
if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 611, __pyx_L1_error)
3685 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3695 __Pyx_TraceLine(612,0,__PYX_ERR(0, 612, __pyx_L1_error))
3696 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_shape);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 612, __pyx_L1_error)
3697 __Pyx_GOTREF(__pyx_t_1);
3698 __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_1, 1,
long, 1, __Pyx_PyInt_From_long, 0, 0, 0);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 612, __pyx_L1_error)
3699 __Pyx_GOTREF(__pyx_t_3);
3700 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3701 __Pyx_DECREF_SET(__pyx_v_max_num_samples, __pyx_t_3);
3720 __Pyx_TraceLine(613,0,__PYX_ERR(0, 613, __pyx_L1_error))
3721 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_shape);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 613, __pyx_L1_error)
3722 __Pyx_GOTREF(__pyx_t_3);
3723 __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_3, 1,
long, 1, __Pyx_PyInt_From_long, 0, 0, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 613, __pyx_L1_error)
3724 __Pyx_GOTREF(__pyx_t_1);
3725 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3726 __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_v_min_num_samples, Py_LT); __Pyx_XGOTREF(__pyx_t_3);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 613, __pyx_L1_error)
3727 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3728 __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_3);
if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 613, __pyx_L1_error)
3729 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3739 __Pyx_TraceLine(614,0,__PYX_ERR(0, 614, __pyx_L1_error))
3740 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_shape);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 614, __pyx_L1_error)
3741 __Pyx_GOTREF(__pyx_t_3);
3742 __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_3, 1,
long, 1, __Pyx_PyInt_From_long, 0, 0, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 614, __pyx_L1_error)
3743 __Pyx_GOTREF(__pyx_t_1);
3744 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3745 __Pyx_DECREF_SET(__pyx_v_min_num_samples, __pyx_t_1);
3764 __Pyx_TraceLine(617,0,__PYX_ERR(0, 617, __pyx_L1_error))
3765 __pyx_t_1 = PyObject_RichCompare(__pyx_v_num_threads, __pyx_int_1, Py_LT); __Pyx_XGOTREF(__pyx_t_1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 617, __pyx_L1_error)
3766 __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_1);
if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 617, __pyx_L1_error)
3767 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3777 __Pyx_TraceLine(618,0,__PYX_ERR(0, 618, __pyx_L1_error))
3778 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_multiprocessing);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 618, __pyx_L1_error)
3779 __Pyx_GOTREF(__pyx_t_3);
3780 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_cpu_count);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 618, __pyx_L1_error)
3781 __Pyx_GOTREF(__pyx_t_5);
3782 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3784 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
3785 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5);
3786 if (likely(__pyx_t_3)) {
3787 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_5);
3788 __Pyx_INCREF(__pyx_t_3);
3789 __Pyx_INCREF(
function);
3790 __Pyx_DECREF_SET(__pyx_t_5,
function);
3793 __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_5);
3794 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
3795 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 618, __pyx_L1_error)
3796 __Pyx_GOTREF(__pyx_t_1);
3797 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
3798 __Pyx_DECREF_SET(__pyx_v_num_threads, __pyx_t_1);
3817 __Pyx_TraceLine(621,0,__PYX_ERR(0, 621, __pyx_L1_error))
3818 __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_get_data_type_name);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 621, __pyx_L1_error)
3819 __Pyx_GOTREF(__pyx_t_5);
3821 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
3822 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5);
3823 if (likely(__pyx_t_3)) {
3824 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_5);
3825 __Pyx_INCREF(__pyx_t_3);
3826 __Pyx_INCREF(
function);
3827 __Pyx_DECREF_SET(__pyx_t_5,
function);
3830 __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_3, __pyx_v_A) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_A);
3831 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
3832 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 621, __pyx_L1_error)
3833 __Pyx_GOTREF(__pyx_t_1);
3834 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
3835 __pyx_v_data_type_name = __pyx_t_1;
3845 __Pyx_TraceLine(622,0,__PYX_ERR(0, 622, __pyx_L1_error))
3846 __pyx_t_8 = (__Pyx_PyBytes_Equals(__pyx_v_data_type_name, __pyx_n_b_float32, Py_EQ));
if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 622, __pyx_L1_error)
3856 __Pyx_TraceLine(626,0,__PYX_ERR(0, 626, __pyx_L1_error))
3857 __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_hutchinson_method_float);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 626, __pyx_L1_error)
3858 __Pyx_GOTREF(__pyx_t_5);
3867 __Pyx_TraceLine(632,0,__PYX_ERR(0, 632, __pyx_L1_error))
3870 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
3871 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5);
3872 if (likely(__pyx_t_3)) {
3873 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_5);
3874 __Pyx_INCREF(__pyx_t_3);
3875 __Pyx_INCREF(
function);
3876 __Pyx_DECREF_SET(__pyx_t_5,
function);
3880 #if CYTHON_FAST_PYCALL
3881 if (PyFunction_Check(__pyx_t_5)) {
3882 PyObject *__pyx_temp[16] = {__pyx_t_3, __pyx_v_A, __pyx_v_B, __pyx_v_C, __pyx_v_gram, __pyx_v_p, __pyx_v_assume_matrix, __pyx_v_min_num_samples, __pyx_v_max_num_samples, __pyx_v_error_atol, __pyx_v_error_rtol, __pyx_v_confidence_level, __pyx_v_outlier_significance_level, __pyx_v_solver_tol, __pyx_v_orthogonalize, __pyx_v_num_threads};
3883 __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_4, 15+__pyx_t_4);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 626, __pyx_L1_error)
3884 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
3885 __Pyx_GOTREF(__pyx_t_1);
3888 #if CYTHON_FAST_PYCCALL
3889 if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
3890 PyObject *__pyx_temp[16] = {__pyx_t_3, __pyx_v_A, __pyx_v_B, __pyx_v_C, __pyx_v_gram, __pyx_v_p, __pyx_v_assume_matrix, __pyx_v_min_num_samples, __pyx_v_max_num_samples, __pyx_v_error_atol, __pyx_v_error_rtol, __pyx_v_confidence_level, __pyx_v_outlier_significance_level, __pyx_v_solver_tol, __pyx_v_orthogonalize, __pyx_v_num_threads};
3891 __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_4, 15+__pyx_t_4);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 626, __pyx_L1_error)
3892 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
3893 __Pyx_GOTREF(__pyx_t_1);
3897 __pyx_t_2 = PyTuple_New(15+__pyx_t_4);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 626, __pyx_L1_error)
3898 __Pyx_GOTREF(__pyx_t_2);
3900 __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3); __pyx_t_3 = NULL;
3902 __Pyx_INCREF(__pyx_v_A);
3903 __Pyx_GIVEREF(__pyx_v_A);
3904 PyTuple_SET_ITEM(__pyx_t_2, 0+__pyx_t_4, __pyx_v_A);
3905 __Pyx_INCREF(__pyx_v_B);
3906 __Pyx_GIVEREF(__pyx_v_B);
3907 PyTuple_SET_ITEM(__pyx_t_2, 1+__pyx_t_4, __pyx_v_B);
3908 __Pyx_INCREF(__pyx_v_C);
3909 __Pyx_GIVEREF(__pyx_v_C);
3910 PyTuple_SET_ITEM(__pyx_t_2, 2+__pyx_t_4, __pyx_v_C);
3911 __Pyx_INCREF(__pyx_v_gram);
3912 __Pyx_GIVEREF(__pyx_v_gram);
3913 PyTuple_SET_ITEM(__pyx_t_2, 3+__pyx_t_4, __pyx_v_gram);
3914 __Pyx_INCREF(__pyx_v_p);
3915 __Pyx_GIVEREF(__pyx_v_p);
3916 PyTuple_SET_ITEM(__pyx_t_2, 4+__pyx_t_4, __pyx_v_p);
3917 __Pyx_INCREF(__pyx_v_assume_matrix);
3918 __Pyx_GIVEREF(__pyx_v_assume_matrix);
3919 PyTuple_SET_ITEM(__pyx_t_2, 5+__pyx_t_4, __pyx_v_assume_matrix);
3920 __Pyx_INCREF(__pyx_v_min_num_samples);
3921 __Pyx_GIVEREF(__pyx_v_min_num_samples);
3922 PyTuple_SET_ITEM(__pyx_t_2, 6+__pyx_t_4, __pyx_v_min_num_samples);
3923 __Pyx_INCREF(__pyx_v_max_num_samples);
3924 __Pyx_GIVEREF(__pyx_v_max_num_samples);
3925 PyTuple_SET_ITEM(__pyx_t_2, 7+__pyx_t_4, __pyx_v_max_num_samples);
3926 __Pyx_INCREF(__pyx_v_error_atol);
3927 __Pyx_GIVEREF(__pyx_v_error_atol);
3928 PyTuple_SET_ITEM(__pyx_t_2, 8+__pyx_t_4, __pyx_v_error_atol);
3929 __Pyx_INCREF(__pyx_v_error_rtol);
3930 __Pyx_GIVEREF(__pyx_v_error_rtol);
3931 PyTuple_SET_ITEM(__pyx_t_2, 9+__pyx_t_4, __pyx_v_error_rtol);
3932 __Pyx_INCREF(__pyx_v_confidence_level);
3933 __Pyx_GIVEREF(__pyx_v_confidence_level);
3934 PyTuple_SET_ITEM(__pyx_t_2, 10+__pyx_t_4, __pyx_v_confidence_level);
3935 __Pyx_INCREF(__pyx_v_outlier_significance_level);
3936 __Pyx_GIVEREF(__pyx_v_outlier_significance_level);
3937 PyTuple_SET_ITEM(__pyx_t_2, 11+__pyx_t_4, __pyx_v_outlier_significance_level);
3938 __Pyx_INCREF(__pyx_v_solver_tol);
3939 __Pyx_GIVEREF(__pyx_v_solver_tol);
3940 PyTuple_SET_ITEM(__pyx_t_2, 12+__pyx_t_4, __pyx_v_solver_tol);
3941 __Pyx_INCREF(__pyx_v_orthogonalize);
3942 __Pyx_GIVEREF(__pyx_v_orthogonalize);
3943 PyTuple_SET_ITEM(__pyx_t_2, 13+__pyx_t_4, __pyx_v_orthogonalize);
3944 __Pyx_INCREF(__pyx_v_num_threads);
3945 __Pyx_GIVEREF(__pyx_v_num_threads);
3946 PyTuple_SET_ITEM(__pyx_t_2, 14+__pyx_t_4, __pyx_v_num_threads);
3947 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_2, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 626, __pyx_L1_error)
3948 __Pyx_GOTREF(__pyx_t_1);
3949 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3951 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
3952 if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
3953 PyObject* sequence = __pyx_t_1;
3954 Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
3955 if (unlikely(size != 11)) {
3956 if (size > 11) __Pyx_RaiseTooManyValuesError(11);
3957 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
3958 __PYX_ERR(0, 623, __pyx_L1_error)
3960 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
3961 if (likely(PyTuple_CheckExact(sequence))) {
3962 __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0);
3963 __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1);
3964 __pyx_t_3 = PyTuple_GET_ITEM(sequence, 2);
3965 __pyx_t_6 = PyTuple_GET_ITEM(sequence, 3);
3966 __pyx_t_9 = PyTuple_GET_ITEM(sequence, 4);
3967 __pyx_t_10 = PyTuple_GET_ITEM(sequence, 5);
3968 __pyx_t_11 = PyTuple_GET_ITEM(sequence, 6);
3969 __pyx_t_12 = PyTuple_GET_ITEM(sequence, 7);
3970 __pyx_t_13 = PyTuple_GET_ITEM(sequence, 8);
3971 __pyx_t_14 = PyTuple_GET_ITEM(sequence, 9);
3972 __pyx_t_15 = PyTuple_GET_ITEM(sequence, 10);
3974 __pyx_t_5 = PyList_GET_ITEM(sequence, 0);
3975 __pyx_t_2 = PyList_GET_ITEM(sequence, 1);
3976 __pyx_t_3 = PyList_GET_ITEM(sequence, 2);
3977 __pyx_t_6 = PyList_GET_ITEM(sequence, 3);
3978 __pyx_t_9 = PyList_GET_ITEM(sequence, 4);
3979 __pyx_t_10 = PyList_GET_ITEM(sequence, 5);
3980 __pyx_t_11 = PyList_GET_ITEM(sequence, 6);
3981 __pyx_t_12 = PyList_GET_ITEM(sequence, 7);
3982 __pyx_t_13 = PyList_GET_ITEM(sequence, 8);
3983 __pyx_t_14 = PyList_GET_ITEM(sequence, 9);
3984 __pyx_t_15 = PyList_GET_ITEM(sequence, 10);
3986 __Pyx_INCREF(__pyx_t_5);
3987 __Pyx_INCREF(__pyx_t_2);
3988 __Pyx_INCREF(__pyx_t_3);
3989 __Pyx_INCREF(__pyx_t_6);
3990 __Pyx_INCREF(__pyx_t_9);
3991 __Pyx_INCREF(__pyx_t_10);
3992 __Pyx_INCREF(__pyx_t_11);
3993 __Pyx_INCREF(__pyx_t_12);
3994 __Pyx_INCREF(__pyx_t_13);
3995 __Pyx_INCREF(__pyx_t_14);
3996 __Pyx_INCREF(__pyx_t_15);
4000 PyObject** temps[11] = {&__pyx_t_5,&__pyx_t_2,&__pyx_t_3,&__pyx_t_6,&__pyx_t_9,&__pyx_t_10,&__pyx_t_11,&__pyx_t_12,&__pyx_t_13,&__pyx_t_14,&__pyx_t_15};
4001 for (i=0; i < 11; i++) {
4002 PyObject* item = PySequence_ITEM(sequence, i);
if (unlikely(!item)) __PYX_ERR(0, 623, __pyx_L1_error)
4008 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4010 Py_ssize_t index = -1;
4011 PyObject** temps[11] = {&__pyx_t_5,&__pyx_t_2,&__pyx_t_3,&__pyx_t_6,&__pyx_t_9,&__pyx_t_10,&__pyx_t_11,&__pyx_t_12,&__pyx_t_13,&__pyx_t_14,&__pyx_t_15};
4012 __pyx_t_16 = PyObject_GetIter(__pyx_t_1);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 623, __pyx_L1_error)
4013 __Pyx_GOTREF(__pyx_t_16);
4014 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4015 __pyx_t_7 = Py_TYPE(__pyx_t_16)->tp_iternext;
4016 for (index=0; index < 11; index++) {
4017 PyObject* item = __pyx_t_7(__pyx_t_16);
if (unlikely(!item))
goto __pyx_L9_unpacking_failed;
4019 *(temps[index]) = item;
4021 if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_16), 11) < 0) __PYX_ERR(0, 623, __pyx_L1_error)
4023 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
4024 goto __pyx_L10_unpacking_done;
4025 __pyx_L9_unpacking_failed:;
4026 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
4028 if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
4029 __PYX_ERR(0, 623, __pyx_L1_error)
4030 __pyx_L10_unpacking_done:;
4040 __Pyx_TraceLine(623,0,__PYX_ERR(0, 623, __pyx_L1_error))
4041 __pyx_v_trace = __pyx_t_5;
4043 __pyx_v_error = __pyx_t_2;
4045 __pyx_v_num_outliers = __pyx_t_3;
4047 __pyx_v_samples = __pyx_t_6;
4049 __pyx_v_processed_samples_indices = __pyx_t_9;
4051 __pyx_v_num_processed_samples = __pyx_t_10;
4053 __pyx_v_num_samples_used = __pyx_t_11;
4055 __pyx_v_converged = __pyx_t_12;
4057 __pyx_v_tot_wall_time = __pyx_t_13;
4059 __pyx_v_alg_wall_time = __pyx_t_14;
4061 __pyx_v_cpu_proc_time = __pyx_t_15;
4081 __Pyx_TraceLine(634,0,__PYX_ERR(0, 634, __pyx_L1_error))
4082 __pyx_t_8 = (__Pyx_PyBytes_Equals(__pyx_v_data_type_name, __pyx_n_b_float64, Py_EQ));
if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 634, __pyx_L1_error)
4083 if (likely(__pyx_t_8)) {
4092 __Pyx_TraceLine(638,0,__PYX_ERR(0, 638, __pyx_L1_error))
4093 __Pyx_GetModuleGlobalName(__pyx_t_15, __pyx_n_s_hutchinson_method_double);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 638, __pyx_L1_error)
4094 __Pyx_GOTREF(__pyx_t_15);
4103 __Pyx_TraceLine(644,0,__PYX_ERR(0, 644, __pyx_L1_error))
4106 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_15))) {
4107 __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_15);
4108 if (likely(__pyx_t_14)) {
4109 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_15);
4110 __Pyx_INCREF(__pyx_t_14);
4111 __Pyx_INCREF(
function);
4112 __Pyx_DECREF_SET(__pyx_t_15,
function);
4116 #if CYTHON_FAST_PYCALL
4117 if (PyFunction_Check(__pyx_t_15)) {
4118 PyObject *__pyx_temp[16] = {__pyx_t_14, __pyx_v_A, __pyx_v_B, __pyx_v_C, __pyx_v_gram, __pyx_v_p, __pyx_v_assume_matrix, __pyx_v_min_num_samples, __pyx_v_max_num_samples, __pyx_v_error_atol, __pyx_v_error_rtol, __pyx_v_confidence_level, __pyx_v_outlier_significance_level, __pyx_v_solver_tol, __pyx_v_orthogonalize, __pyx_v_num_threads};
4119 __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_15, __pyx_temp+1-__pyx_t_4, 15+__pyx_t_4);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 638, __pyx_L1_error)
4120 __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
4121 __Pyx_GOTREF(__pyx_t_1);
4124 #if CYTHON_FAST_PYCCALL
4125 if (__Pyx_PyFastCFunction_Check(__pyx_t_15)) {
4126 PyObject *__pyx_temp[16] = {__pyx_t_14, __pyx_v_A, __pyx_v_B, __pyx_v_C, __pyx_v_gram, __pyx_v_p, __pyx_v_assume_matrix, __pyx_v_min_num_samples, __pyx_v_max_num_samples, __pyx_v_error_atol, __pyx_v_error_rtol, __pyx_v_confidence_level, __pyx_v_outlier_significance_level, __pyx_v_solver_tol, __pyx_v_orthogonalize, __pyx_v_num_threads};
4127 __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_15, __pyx_temp+1-__pyx_t_4, 15+__pyx_t_4);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 638, __pyx_L1_error)
4128 __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
4129 __Pyx_GOTREF(__pyx_t_1);
4133 __pyx_t_13 = PyTuple_New(15+__pyx_t_4);
if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 638, __pyx_L1_error)
4134 __Pyx_GOTREF(__pyx_t_13);
4136 __Pyx_GIVEREF(__pyx_t_14); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_14); __pyx_t_14 = NULL;
4138 __Pyx_INCREF(__pyx_v_A);
4139 __Pyx_GIVEREF(__pyx_v_A);
4140 PyTuple_SET_ITEM(__pyx_t_13, 0+__pyx_t_4, __pyx_v_A);
4141 __Pyx_INCREF(__pyx_v_B);
4142 __Pyx_GIVEREF(__pyx_v_B);
4143 PyTuple_SET_ITEM(__pyx_t_13, 1+__pyx_t_4, __pyx_v_B);
4144 __Pyx_INCREF(__pyx_v_C);
4145 __Pyx_GIVEREF(__pyx_v_C);
4146 PyTuple_SET_ITEM(__pyx_t_13, 2+__pyx_t_4, __pyx_v_C);
4147 __Pyx_INCREF(__pyx_v_gram);
4148 __Pyx_GIVEREF(__pyx_v_gram);
4149 PyTuple_SET_ITEM(__pyx_t_13, 3+__pyx_t_4, __pyx_v_gram);
4150 __Pyx_INCREF(__pyx_v_p);
4151 __Pyx_GIVEREF(__pyx_v_p);
4152 PyTuple_SET_ITEM(__pyx_t_13, 4+__pyx_t_4, __pyx_v_p);
4153 __Pyx_INCREF(__pyx_v_assume_matrix);
4154 __Pyx_GIVEREF(__pyx_v_assume_matrix);
4155 PyTuple_SET_ITEM(__pyx_t_13, 5+__pyx_t_4, __pyx_v_assume_matrix);
4156 __Pyx_INCREF(__pyx_v_min_num_samples);
4157 __Pyx_GIVEREF(__pyx_v_min_num_samples);
4158 PyTuple_SET_ITEM(__pyx_t_13, 6+__pyx_t_4, __pyx_v_min_num_samples);
4159 __Pyx_INCREF(__pyx_v_max_num_samples);
4160 __Pyx_GIVEREF(__pyx_v_max_num_samples);
4161 PyTuple_SET_ITEM(__pyx_t_13, 7+__pyx_t_4, __pyx_v_max_num_samples);
4162 __Pyx_INCREF(__pyx_v_error_atol);
4163 __Pyx_GIVEREF(__pyx_v_error_atol);
4164 PyTuple_SET_ITEM(__pyx_t_13, 8+__pyx_t_4, __pyx_v_error_atol);
4165 __Pyx_INCREF(__pyx_v_error_rtol);
4166 __Pyx_GIVEREF(__pyx_v_error_rtol);
4167 PyTuple_SET_ITEM(__pyx_t_13, 9+__pyx_t_4, __pyx_v_error_rtol);
4168 __Pyx_INCREF(__pyx_v_confidence_level);
4169 __Pyx_GIVEREF(__pyx_v_confidence_level);
4170 PyTuple_SET_ITEM(__pyx_t_13, 10+__pyx_t_4, __pyx_v_confidence_level);
4171 __Pyx_INCREF(__pyx_v_outlier_significance_level);
4172 __Pyx_GIVEREF(__pyx_v_outlier_significance_level);
4173 PyTuple_SET_ITEM(__pyx_t_13, 11+__pyx_t_4, __pyx_v_outlier_significance_level);
4174 __Pyx_INCREF(__pyx_v_solver_tol);
4175 __Pyx_GIVEREF(__pyx_v_solver_tol);
4176 PyTuple_SET_ITEM(__pyx_t_13, 12+__pyx_t_4, __pyx_v_solver_tol);
4177 __Pyx_INCREF(__pyx_v_orthogonalize);
4178 __Pyx_GIVEREF(__pyx_v_orthogonalize);
4179 PyTuple_SET_ITEM(__pyx_t_13, 13+__pyx_t_4, __pyx_v_orthogonalize);
4180 __Pyx_INCREF(__pyx_v_num_threads);
4181 __Pyx_GIVEREF(__pyx_v_num_threads);
4182 PyTuple_SET_ITEM(__pyx_t_13, 14+__pyx_t_4, __pyx_v_num_threads);
4183 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_15, __pyx_t_13, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 638, __pyx_L1_error)
4184 __Pyx_GOTREF(__pyx_t_1);
4185 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
4187 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
4188 if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
4189 PyObject* sequence = __pyx_t_1;
4190 Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
4191 if (unlikely(size != 11)) {
4192 if (size > 11) __Pyx_RaiseTooManyValuesError(11);
4193 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
4194 __PYX_ERR(0, 635, __pyx_L1_error)
4196 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
4197 if (likely(PyTuple_CheckExact(sequence))) {
4198 __pyx_t_15 = PyTuple_GET_ITEM(sequence, 0);
4199 __pyx_t_13 = PyTuple_GET_ITEM(sequence, 1);
4200 __pyx_t_14 = PyTuple_GET_ITEM(sequence, 2);
4201 __pyx_t_12 = PyTuple_GET_ITEM(sequence, 3);
4202 __pyx_t_11 = PyTuple_GET_ITEM(sequence, 4);
4203 __pyx_t_10 = PyTuple_GET_ITEM(sequence, 5);
4204 __pyx_t_9 = PyTuple_GET_ITEM(sequence, 6);
4205 __pyx_t_6 = PyTuple_GET_ITEM(sequence, 7);
4206 __pyx_t_3 = PyTuple_GET_ITEM(sequence, 8);
4207 __pyx_t_2 = PyTuple_GET_ITEM(sequence, 9);
4208 __pyx_t_5 = PyTuple_GET_ITEM(sequence, 10);
4210 __pyx_t_15 = PyList_GET_ITEM(sequence, 0);
4211 __pyx_t_13 = PyList_GET_ITEM(sequence, 1);
4212 __pyx_t_14 = PyList_GET_ITEM(sequence, 2);
4213 __pyx_t_12 = PyList_GET_ITEM(sequence, 3);
4214 __pyx_t_11 = PyList_GET_ITEM(sequence, 4);
4215 __pyx_t_10 = PyList_GET_ITEM(sequence, 5);
4216 __pyx_t_9 = PyList_GET_ITEM(sequence, 6);
4217 __pyx_t_6 = PyList_GET_ITEM(sequence, 7);
4218 __pyx_t_3 = PyList_GET_ITEM(sequence, 8);
4219 __pyx_t_2 = PyList_GET_ITEM(sequence, 9);
4220 __pyx_t_5 = PyList_GET_ITEM(sequence, 10);
4222 __Pyx_INCREF(__pyx_t_15);
4223 __Pyx_INCREF(__pyx_t_13);
4224 __Pyx_INCREF(__pyx_t_14);
4225 __Pyx_INCREF(__pyx_t_12);
4226 __Pyx_INCREF(__pyx_t_11);
4227 __Pyx_INCREF(__pyx_t_10);
4228 __Pyx_INCREF(__pyx_t_9);
4229 __Pyx_INCREF(__pyx_t_6);
4230 __Pyx_INCREF(__pyx_t_3);
4231 __Pyx_INCREF(__pyx_t_2);
4232 __Pyx_INCREF(__pyx_t_5);
4236 PyObject** temps[11] = {&__pyx_t_15,&__pyx_t_13,&__pyx_t_14,&__pyx_t_12,&__pyx_t_11,&__pyx_t_10,&__pyx_t_9,&__pyx_t_6,&__pyx_t_3,&__pyx_t_2,&__pyx_t_5};
4237 for (i=0; i < 11; i++) {
4238 PyObject* item = PySequence_ITEM(sequence, i);
if (unlikely(!item)) __PYX_ERR(0, 635, __pyx_L1_error)
4244 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4246 Py_ssize_t index = -1;
4247 PyObject** temps[11] = {&__pyx_t_15,&__pyx_t_13,&__pyx_t_14,&__pyx_t_12,&__pyx_t_11,&__pyx_t_10,&__pyx_t_9,&__pyx_t_6,&__pyx_t_3,&__pyx_t_2,&__pyx_t_5};
4248 __pyx_t_16 = PyObject_GetIter(__pyx_t_1);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 635, __pyx_L1_error)
4249 __Pyx_GOTREF(__pyx_t_16);
4250 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4251 __pyx_t_7 = Py_TYPE(__pyx_t_16)->tp_iternext;
4252 for (index=0; index < 11; index++) {
4253 PyObject* item = __pyx_t_7(__pyx_t_16);
if (unlikely(!item))
goto __pyx_L11_unpacking_failed;
4255 *(temps[index]) = item;
4257 if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_16), 11) < 0) __PYX_ERR(0, 635, __pyx_L1_error)
4259 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
4260 goto __pyx_L12_unpacking_done;
4261 __pyx_L11_unpacking_failed:;
4262 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
4264 if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
4265 __PYX_ERR(0, 635, __pyx_L1_error)
4266 __pyx_L12_unpacking_done:;
4276 __Pyx_TraceLine(635,0,__PYX_ERR(0, 635, __pyx_L1_error))
4277 __pyx_v_trace = __pyx_t_15;
4279 __pyx_v_error = __pyx_t_13;
4281 __pyx_v_num_outliers = __pyx_t_14;
4283 __pyx_v_samples = __pyx_t_12;
4285 __pyx_v_processed_samples_indices = __pyx_t_11;
4287 __pyx_v_num_processed_samples = __pyx_t_10;
4289 __pyx_v_num_samples_used = __pyx_t_9;
4291 __pyx_v_converged = __pyx_t_6;
4293 __pyx_v_tot_wall_time = __pyx_t_3;
4295 __pyx_v_alg_wall_time = __pyx_t_2;
4297 __pyx_v_cpu_proc_time = __pyx_t_5;
4317 __Pyx_TraceLine(646,0,__PYX_ERR(0, 646, __pyx_L1_error))
4319 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__2, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 646, __pyx_L1_error)
4320 __Pyx_GOTREF(__pyx_t_1);
4321 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
4322 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4323 __PYX_ERR(0, 646, __pyx_L1_error)
4334 __Pyx_TraceLine(650,0,__PYX_ERR(0, 650, __pyx_L1_error))
4335 __pyx_t_1 = __Pyx_PyDict_NewPresized(6);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 650, __pyx_L1_error)
4336 __Pyx_GOTREF(__pyx_t_1);
4345 __Pyx_TraceLine(652,0,__PYX_ERR(0, 652, __pyx_L1_error))
4346 __pyx_t_5 = __Pyx_PyDict_NewPresized(9);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 652, __pyx_L1_error)
4347 __Pyx_GOTREF(__pyx_t_5);
4348 if (PyDict_SetItem(__pyx_t_5, __pyx_n_u_data_type, __pyx_v_data_type_name) < 0) __PYX_ERR(0, 652, __pyx_L1_error)
4357 __Pyx_TraceLine(653,0,__PYX_ERR(0, 653, __pyx_L1_error))
4358 if (PyDict_SetItem(__pyx_t_5, __pyx_n_u_gram, __pyx_v_gram) < 0) __PYX_ERR(0, 652, __pyx_L1_error)
4367 __Pyx_TraceLine(654,0,__PYX_ERR(0, 654, __pyx_L1_error))
4368 if (PyDict_SetItem(__pyx_t_5, __pyx_n_u_exponent, __pyx_v_p) < 0) __PYX_ERR(0, 652, __pyx_L1_error)
4377 __Pyx_TraceLine(655,0,__PYX_ERR(0, 655, __pyx_L1_error))
4378 if (PyDict_SetItem(__pyx_t_5, __pyx_n_u_assume_matrix, __pyx_v_assume_matrix) < 0) __PYX_ERR(0, 652, __pyx_L1_error)
4387 __Pyx_TraceLine(656,0,__PYX_ERR(0, 656, __pyx_L1_error))
4388 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_shape);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 656, __pyx_L1_error)
4389 __Pyx_GOTREF(__pyx_t_2);
4390 if (PyDict_SetItem(__pyx_t_5, __pyx_n_u_size, __pyx_t_2) < 0) __PYX_ERR(0, 652, __pyx_L1_error)
4391 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4400 __Pyx_TraceLine(657,0,__PYX_ERR(0, 657, __pyx_L1_error))
4401 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_isspmatrix);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 657, __pyx_L1_error)
4402 __Pyx_GOTREF(__pyx_t_3);
4404 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
4405 __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_3);
4406 if (likely(__pyx_t_6)) {
4407 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
4408 __Pyx_INCREF(__pyx_t_6);
4409 __Pyx_INCREF(
function);
4410 __Pyx_DECREF_SET(__pyx_t_3,
function);
4413 __pyx_t_2 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_6, __pyx_v_A) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_A);
4414 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
4415 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 657, __pyx_L1_error)
4416 __Pyx_GOTREF(__pyx_t_2);
4417 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4418 if (PyDict_SetItem(__pyx_t_5, __pyx_n_u_sparse, __pyx_t_2) < 0) __PYX_ERR(0, 652, __pyx_L1_error)
4419 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4428 __Pyx_TraceLine(658,0,__PYX_ERR(0, 658, __pyx_L1_error))
4429 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_get_nnz);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 658, __pyx_L1_error)
4430 __Pyx_GOTREF(__pyx_t_3);
4432 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
4433 __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_3);
4434 if (likely(__pyx_t_6)) {
4435 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
4436 __Pyx_INCREF(__pyx_t_6);
4437 __Pyx_INCREF(
function);
4438 __Pyx_DECREF_SET(__pyx_t_3,
function);
4441 __pyx_t_2 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_6, __pyx_v_A) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_A);
4442 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
4443 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 658, __pyx_L1_error)
4444 __Pyx_GOTREF(__pyx_t_2);
4445 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4446 if (PyDict_SetItem(__pyx_t_5, __pyx_n_u_nnz, __pyx_t_2) < 0) __PYX_ERR(0, 652, __pyx_L1_error)
4447 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4456 __Pyx_TraceLine(659,0,__PYX_ERR(0, 659, __pyx_L1_error))
4457 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_get_density);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 659, __pyx_L1_error)
4458 __Pyx_GOTREF(__pyx_t_3);
4460 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
4461 __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_3);
4462 if (likely(__pyx_t_6)) {
4463 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
4464 __Pyx_INCREF(__pyx_t_6);
4465 __Pyx_INCREF(
function);
4466 __Pyx_DECREF_SET(__pyx_t_3,
function);
4469 __pyx_t_2 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_6, __pyx_v_A) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_A);
4470 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
4471 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 659, __pyx_L1_error)
4472 __Pyx_GOTREF(__pyx_t_2);
4473 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4474 if (PyDict_SetItem(__pyx_t_5, __pyx_n_u_density, __pyx_t_2) < 0) __PYX_ERR(0, 652, __pyx_L1_error)
4475 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4476 if (PyDict_SetItem(__pyx_t_5, __pyx_n_u_num_inquiries, __pyx_int_1) < 0) __PYX_ERR(0, 652, __pyx_L1_error)
4477 if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_matrix, __pyx_t_5) < 0) __PYX_ERR(0, 650, __pyx_L1_error)
4478 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
4487 __Pyx_TraceLine(664,0,__PYX_ERR(0, 664, __pyx_L1_error))
4488 __pyx_t_5 = __Pyx_PyDict_NewPresized(6);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 664, __pyx_L1_error)
4489 __Pyx_GOTREF(__pyx_t_5);
4490 if (PyDict_SetItem(__pyx_t_5, __pyx_n_u_absolute_error, __pyx_v_error) < 0) __PYX_ERR(0, 664, __pyx_L1_error)
4499 __Pyx_TraceLine(665,0,__PYX_ERR(0, 665, __pyx_L1_error))
4500 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_numpy);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 665, __pyx_L1_error)
4501 __Pyx_GOTREF(__pyx_t_3);
4502 __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_abs);
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 665, __pyx_L1_error)
4503 __Pyx_GOTREF(__pyx_t_6);
4504 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4506 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
4507 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_6);
4508 if (likely(__pyx_t_3)) {
4509 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_6);
4510 __Pyx_INCREF(__pyx_t_3);
4511 __Pyx_INCREF(
function);
4512 __Pyx_DECREF_SET(__pyx_t_6,
function);
4515 __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_3, __pyx_v_trace) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_trace);
4516 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
4517 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 665, __pyx_L1_error)
4518 __Pyx_GOTREF(__pyx_t_2);
4519 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
4520 __pyx_t_6 = __Pyx_PyNumber_Divide(__pyx_v_error, __pyx_t_2);
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 665, __pyx_L1_error)
4521 __Pyx_GOTREF(__pyx_t_6);
4522 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4523 if (PyDict_SetItem(__pyx_t_5, __pyx_n_u_relative_error, __pyx_t_6) < 0) __PYX_ERR(0, 664, __pyx_L1_error)
4524 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
4533 __Pyx_TraceLine(666,0,__PYX_ERR(0, 666, __pyx_L1_error))
4534 if (PyDict_SetItem(__pyx_t_5, __pyx_n_u_error_atol, __pyx_v_error_atol) < 0) __PYX_ERR(0, 664, __pyx_L1_error)
4543 __Pyx_TraceLine(667,0,__PYX_ERR(0, 667, __pyx_L1_error))
4544 if (PyDict_SetItem(__pyx_t_5, __pyx_n_u_error_rtol, __pyx_v_error_rtol) < 0) __PYX_ERR(0, 664, __pyx_L1_error)
4553 __Pyx_TraceLine(668,0,__PYX_ERR(0, 668, __pyx_L1_error))
4554 if (PyDict_SetItem(__pyx_t_5, __pyx_n_u_confidence_level, __pyx_v_confidence_level) < 0) __PYX_ERR(0, 664, __pyx_L1_error)
4563 __Pyx_TraceLine(669,0,__PYX_ERR(0, 669, __pyx_L1_error))
4564 if (PyDict_SetItem(__pyx_t_5, __pyx_n_u_outlier_significance_level, __pyx_v_outlier_significance_level) < 0) __PYX_ERR(0, 664, __pyx_L1_error)
4565 if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_error, __pyx_t_5) < 0) __PYX_ERR(0, 650, __pyx_L1_error)
4566 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
4575 __Pyx_TraceLine(673,0,__PYX_ERR(0, 673, __pyx_L1_error))
4576 __pyx_t_5 = __Pyx_PyDict_NewPresized(8);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 673, __pyx_L1_error)
4577 __Pyx_GOTREF(__pyx_t_5);
4578 __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_converged);
if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 673, __pyx_L1_error)
4579 __pyx_t_6 = __Pyx_PyBool_FromLong((!(!__pyx_t_8)));
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 673, __pyx_L1_error)
4580 __Pyx_GOTREF(__pyx_t_6);
4581 if (PyDict_SetItem(__pyx_t_5, __pyx_n_u_converged, __pyx_t_6) < 0) __PYX_ERR(0, 673, __pyx_L1_error)
4582 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
4591 __Pyx_TraceLine(674,0,__PYX_ERR(0, 674, __pyx_L1_error))
4592 if (PyDict_SetItem(__pyx_t_5, __pyx_n_u_min_num_samples, __pyx_v_min_num_samples) < 0) __PYX_ERR(0, 673, __pyx_L1_error)
4601 __Pyx_TraceLine(675,0,__PYX_ERR(0, 675, __pyx_L1_error))
4602 if (PyDict_SetItem(__pyx_t_5, __pyx_n_u_max_num_samples, __pyx_v_max_num_samples) < 0) __PYX_ERR(0, 673, __pyx_L1_error)
4611 __Pyx_TraceLine(676,0,__PYX_ERR(0, 676, __pyx_L1_error))
4612 if (PyDict_SetItem(__pyx_t_5, __pyx_n_u_num_samples_used, __pyx_v_num_samples_used) < 0) __PYX_ERR(0, 673, __pyx_L1_error)
4621 __Pyx_TraceLine(677,0,__PYX_ERR(0, 677, __pyx_L1_error))
4622 if (PyDict_SetItem(__pyx_t_5, __pyx_n_u_num_outliers, __pyx_v_num_outliers) < 0) __PYX_ERR(0, 673, __pyx_L1_error)
4631 __Pyx_TraceLine(678,0,__PYX_ERR(0, 678, __pyx_L1_error))
4632 if (PyDict_SetItem(__pyx_t_5, __pyx_n_u_samples, __pyx_v_samples) < 0) __PYX_ERR(0, 673, __pyx_L1_error)
4641 __Pyx_TraceLine(679,0,__PYX_ERR(0, 679, __pyx_L1_error))
4642 if (PyDict_SetItem(__pyx_t_5, __pyx_n_u_samples_mean, __pyx_v_trace) < 0) __PYX_ERR(0, 673, __pyx_L1_error)
4651 __Pyx_TraceLine(680,0,__PYX_ERR(0, 680, __pyx_L1_error))
4652 if (PyDict_SetItem(__pyx_t_5, __pyx_n_u_samples_processed_order, __pyx_v_processed_samples_indices) < 0) __PYX_ERR(0, 673, __pyx_L1_error)
4653 if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_convergence, __pyx_t_5) < 0) __PYX_ERR(0, 650, __pyx_L1_error)
4654 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
4663 __Pyx_TraceLine(684,0,__PYX_ERR(0, 684, __pyx_L1_error))
4664 __pyx_t_5 = __Pyx_PyDict_NewPresized(4);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 684, __pyx_L1_error)
4665 __Pyx_GOTREF(__pyx_t_5);
4666 if (PyDict_SetItem(__pyx_t_5, __pyx_n_u_num_cpu_threads, __pyx_v_num_threads) < 0) __PYX_ERR(0, 684, __pyx_L1_error)
4667 if (PyDict_SetItem(__pyx_t_5, __pyx_n_u_num_gpu_devices, __pyx_int_0) < 0) __PYX_ERR(0, 684, __pyx_L1_error)
4668 if (PyDict_SetItem(__pyx_t_5, __pyx_n_u_num_gpu_multiprocessors, __pyx_int_0) < 0) __PYX_ERR(0, 684, __pyx_L1_error)
4669 if (PyDict_SetItem(__pyx_t_5, __pyx_n_u_num_gpu_threads_per_multiprocess, __pyx_int_0) < 0) __PYX_ERR(0, 684, __pyx_L1_error)
4670 if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_device, __pyx_t_5) < 0) __PYX_ERR(0, 650, __pyx_L1_error)
4671 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
4680 __Pyx_TraceLine(691,0,__PYX_ERR(0, 691, __pyx_L1_error))
4681 __pyx_t_5 = __Pyx_PyDict_NewPresized(3);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 691, __pyx_L1_error)
4682 __Pyx_GOTREF(__pyx_t_5);
4683 if (PyDict_SetItem(__pyx_t_5, __pyx_n_u_tot_wall_time, __pyx_v_tot_wall_time) < 0) __PYX_ERR(0, 691, __pyx_L1_error)
4692 __Pyx_TraceLine(692,0,__PYX_ERR(0, 692, __pyx_L1_error))
4693 if (PyDict_SetItem(__pyx_t_5, __pyx_n_u_alg_wall_time, __pyx_v_alg_wall_time) < 0) __PYX_ERR(0, 691, __pyx_L1_error)
4702 __Pyx_TraceLine(693,0,__PYX_ERR(0, 693, __pyx_L1_error))
4703 if (PyDict_SetItem(__pyx_t_5, __pyx_n_u_cpu_proc_time, __pyx_v_cpu_proc_time) < 0) __PYX_ERR(0, 691, __pyx_L1_error)
4704 if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_time, __pyx_t_5) < 0) __PYX_ERR(0, 650, __pyx_L1_error)
4705 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
4714 __Pyx_TraceLine(697,0,__PYX_ERR(0, 697, __pyx_L1_error))
4715 __pyx_t_5 = __Pyx_PyDict_NewPresized(4);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 697, __pyx_L1_error)
4716 __Pyx_GOTREF(__pyx_t_5);
4717 __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_version_2);
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 697, __pyx_L1_error)
4718 __Pyx_GOTREF(__pyx_t_6);
4719 if (PyDict_SetItem(__pyx_t_5, __pyx_n_u_version, __pyx_t_6) < 0) __PYX_ERR(0, 697, __pyx_L1_error)
4720 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
4729 __Pyx_TraceLine(698,0,__PYX_ERR(0, 698, __pyx_L1_error))
4730 if (PyDict_SetItem(__pyx_t_5, __pyx_n_u_orthogonalize, __pyx_v_orthogonalize) < 0) __PYX_ERR(0, 697, __pyx_L1_error)
4739 __Pyx_TraceLine(699,0,__PYX_ERR(0, 699, __pyx_L1_error))
4740 if (PyDict_SetItem(__pyx_t_5, __pyx_n_u_solver_tol, __pyx_v_solver_tol) < 0) __PYX_ERR(0, 697, __pyx_L1_error)
4741 if (PyDict_SetItem(__pyx_t_5, __pyx_n_u_method, __pyx_n_u_hutchinson) < 0) __PYX_ERR(0, 697, __pyx_L1_error)
4742 if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_solver, __pyx_t_5) < 0) __PYX_ERR(0, 650, __pyx_L1_error)
4743 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
4744 __pyx_v_info = ((PyObject*)__pyx_t_1);
4754 __Pyx_TraceLine(705,0,__PYX_ERR(0, 705, __pyx_L1_error))
4755 __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_verbose);
if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 705, __pyx_L1_error)
4765 __Pyx_TraceLine(706,0,__PYX_ERR(0, 706, __pyx_L1_error))
4766 __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_print_summary);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 706, __pyx_L1_error)
4767 __Pyx_GOTREF(__pyx_t_5);
4769 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
4770 __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
4771 if (likely(__pyx_t_6)) {
4772 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_5);
4773 __Pyx_INCREF(__pyx_t_6);
4774 __Pyx_INCREF(
function);
4775 __Pyx_DECREF_SET(__pyx_t_5,
function);
4778 __pyx_t_1 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_v_info) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_info);
4779 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
4780 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 706, __pyx_L1_error)
4781 __Pyx_GOTREF(__pyx_t_1);
4782 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
4783 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4801 __Pyx_TraceLine(709,0,__PYX_ERR(0, 709, __pyx_L1_error))
4802 __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_plot);
if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 709, __pyx_L1_error)
4812 __Pyx_TraceLine(710,0,__PYX_ERR(0, 710, __pyx_L1_error))
4813 __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_plot_convergence);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 710, __pyx_L1_error)
4814 __Pyx_GOTREF(__pyx_t_5);
4816 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
4817 __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
4818 if (likely(__pyx_t_6)) {
4819 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_5);
4820 __Pyx_INCREF(__pyx_t_6);
4821 __Pyx_INCREF(
function);
4822 __Pyx_DECREF_SET(__pyx_t_5,
function);
4825 __pyx_t_1 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_v_info) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_info);
4826 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
4827 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 710, __pyx_L1_error)
4828 __Pyx_GOTREF(__pyx_t_1);
4829 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
4830 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4848 __Pyx_TraceLine(712,0,__PYX_ERR(0, 712, __pyx_L1_error))
4849 __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_return_info);
if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 712, __pyx_L1_error)
4859 __Pyx_TraceLine(713,0,__PYX_ERR(0, 713, __pyx_L1_error))
4860 __Pyx_XDECREF(__pyx_r);
4861 __pyx_t_1 = PyTuple_New(2);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 713, __pyx_L1_error)
4862 __Pyx_GOTREF(__pyx_t_1);
4863 __Pyx_INCREF(__pyx_v_trace);
4864 __Pyx_GIVEREF(__pyx_v_trace);
4865 PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_trace);
4866 __Pyx_INCREF(__pyx_v_info);
4867 __Pyx_GIVEREF(__pyx_v_info);
4868 PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_info);
4869 __pyx_r = __pyx_t_1;
4889 __Pyx_TraceLine(715,0,__PYX_ERR(0, 715, __pyx_L1_error))
4891 __Pyx_XDECREF(__pyx_r);
4892 __Pyx_INCREF(__pyx_v_trace);
4893 __pyx_r = __pyx_v_trace;
4907 __Pyx_XDECREF(__pyx_t_1);
4908 __Pyx_XDECREF(__pyx_t_2);
4909 __Pyx_XDECREF(__pyx_t_3);
4910 __Pyx_XDECREF(__pyx_t_5);
4911 __Pyx_XDECREF(__pyx_t_6);
4912 __Pyx_XDECREF(__pyx_t_9);
4913 __Pyx_XDECREF(__pyx_t_10);
4914 __Pyx_XDECREF(__pyx_t_11);
4915 __Pyx_XDECREF(__pyx_t_12);
4916 __Pyx_XDECREF(__pyx_t_13);
4917 __Pyx_XDECREF(__pyx_t_14);
4918 __Pyx_XDECREF(__pyx_t_15);
4919 __Pyx_XDECREF(__pyx_t_16);
4920 __Pyx_AddTraceback(
"imate.traceinv._hutchinson_method.hutchinson_method", __pyx_clineno, __pyx_lineno, __pyx_filename);
4923 __Pyx_XDECREF(__pyx_v_square);
4924 __Pyx_XDECREF(__pyx_v_data_type_name);
4925 __Pyx_XDECREF(__pyx_v_trace);
4926 __Pyx_XDECREF(__pyx_v_error);
4927 __Pyx_XDECREF(__pyx_v_num_outliers);
4928 __Pyx_XDECREF(__pyx_v_samples);
4929 __Pyx_XDECREF(__pyx_v_processed_samples_indices);
4930 __Pyx_XDECREF(__pyx_v_num_processed_samples);
4931 __Pyx_XDECREF(__pyx_v_num_samples_used);
4932 __Pyx_XDECREF(__pyx_v_converged);
4933 __Pyx_XDECREF(__pyx_v_tot_wall_time);
4934 __Pyx_XDECREF(__pyx_v_alg_wall_time);
4935 __Pyx_XDECREF(__pyx_v_cpu_proc_time);
4936 __Pyx_XDECREF(__pyx_v_info);
4937 __Pyx_XDECREF(__pyx_v_min_num_samples);
4938 __Pyx_XDECREF(__pyx_v_max_num_samples);
4939 __Pyx_XDECREF(__pyx_v_error_atol);
4940 __Pyx_XDECREF(__pyx_v_error_rtol);
4941 __Pyx_XDECREF(__pyx_v_num_threads);
4942 __Pyx_XGIVEREF(__pyx_r);
4943 __Pyx_TraceReturn(__pyx_r, 0);
4944 __Pyx_RefNannyFinishContext();
4957 static PyObject *__pyx_pw_5imate_8traceinv_18_hutchinson_method_3_hutchinson_method_float(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
4958 static char __pyx_doc_5imate_8traceinv_18_hutchinson_method_2_hutchinson_method_float[] =
"_hutchinson_method_float(A, B, C, gram, p, assume_matrix, min_num_samples, max_num_samples, error_atol, error_rtol, confidence_level, outlier_significance_level, solver_tol, orthogonalize, num_threads)\n\n This method processes single precision (32-bit) matrix ``A``.\n ";
4959 static PyMethodDef __pyx_mdef_5imate_8traceinv_18_hutchinson_method_3_hutchinson_method_float = {
"_hutchinson_method_float", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_5imate_8traceinv_18_hutchinson_method_3_hutchinson_method_float, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5imate_8traceinv_18_hutchinson_method_2_hutchinson_method_float};
4960 static PyObject *__pyx_pw_5imate_8traceinv_18_hutchinson_method_3_hutchinson_method_float(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
4961 PyObject *__pyx_v_A = 0;
4962 PyObject *__pyx_v_B = 0;
4963 PyObject *__pyx_v_C = 0;
4964 PyObject *__pyx_v_gram = 0;
4965 PyObject *__pyx_v_p = 0;
4966 PyObject *__pyx_v_assume_matrix = 0;
4967 PyObject *__pyx_v_min_num_samples = 0;
4968 PyObject *__pyx_v_max_num_samples = 0;
4969 PyObject *__pyx_v_error_atol = 0;
4970 PyObject *__pyx_v_error_rtol = 0;
4971 PyObject *__pyx_v_confidence_level = 0;
4972 PyObject *__pyx_v_outlier_significance_level = 0;
4973 PyObject *__pyx_v_solver_tol = 0;
4974 PyObject *__pyx_v_orthogonalize = 0;
4975 PyObject *__pyx_v_num_threads = 0;
4976 int __pyx_lineno = 0;
4977 const char *__pyx_filename = NULL;
4978 int __pyx_clineno = 0;
4979 PyObject *__pyx_r = 0;
4980 __Pyx_RefNannyDeclarations
4981 __Pyx_RefNannySetupContext(
"_hutchinson_method_float (wrapper)", 0);
4983 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_A,&__pyx_n_s_B,&__pyx_n_s_C,&__pyx_n_s_gram,&__pyx_n_s_p,&__pyx_n_s_assume_matrix,&__pyx_n_s_min_num_samples,&__pyx_n_s_max_num_samples,&__pyx_n_s_error_atol,&__pyx_n_s_error_rtol,&__pyx_n_s_confidence_level,&__pyx_n_s_outlier_significance_level,&__pyx_n_s_solver_tol,&__pyx_n_s_orthogonalize,&__pyx_n_s_num_threads,0};
4984 PyObject* values[15] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
4985 if (unlikely(__pyx_kwds)) {
4987 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
4989 case 15: values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
4991 case 14: values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
4993 case 13: values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
4995 case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
4997 case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
4999 case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
5001 case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
5003 case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
5005 case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
5007 case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
5009 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
5011 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
5013 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5015 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5017 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5020 default:
goto __pyx_L5_argtuple_error;
5022 kw_args = PyDict_Size(__pyx_kwds);
5025 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_A)) != 0)) kw_args--;
5026 else goto __pyx_L5_argtuple_error;
5029 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_B)) != 0)) kw_args--;
5031 __Pyx_RaiseArgtupleInvalid(
"_hutchinson_method_float", 1, 15, 15, 1); __PYX_ERR(0, 722, __pyx_L3_error)
5035 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_C)) != 0)) kw_args--;
5037 __Pyx_RaiseArgtupleInvalid(
"_hutchinson_method_float", 1, 15, 15, 2); __PYX_ERR(0, 722, __pyx_L3_error)
5041 if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_gram)) != 0)) kw_args--;
5043 __Pyx_RaiseArgtupleInvalid(
"_hutchinson_method_float", 1, 15, 15, 3); __PYX_ERR(0, 722, __pyx_L3_error)
5047 if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_p)) != 0)) kw_args--;
5049 __Pyx_RaiseArgtupleInvalid(
"_hutchinson_method_float", 1, 15, 15, 4); __PYX_ERR(0, 722, __pyx_L3_error)
5053 if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_assume_matrix)) != 0)) kw_args--;
5055 __Pyx_RaiseArgtupleInvalid(
"_hutchinson_method_float", 1, 15, 15, 5); __PYX_ERR(0, 722, __pyx_L3_error)
5059 if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_min_num_samples)) != 0)) kw_args--;
5061 __Pyx_RaiseArgtupleInvalid(
"_hutchinson_method_float", 1, 15, 15, 6); __PYX_ERR(0, 722, __pyx_L3_error)
5065 if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_max_num_samples)) != 0)) kw_args--;
5067 __Pyx_RaiseArgtupleInvalid(
"_hutchinson_method_float", 1, 15, 15, 7); __PYX_ERR(0, 722, __pyx_L3_error)
5071 if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_error_atol)) != 0)) kw_args--;
5073 __Pyx_RaiseArgtupleInvalid(
"_hutchinson_method_float", 1, 15, 15, 8); __PYX_ERR(0, 722, __pyx_L3_error)
5077 if (likely((values[9] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_error_rtol)) != 0)) kw_args--;
5079 __Pyx_RaiseArgtupleInvalid(
"_hutchinson_method_float", 1, 15, 15, 9); __PYX_ERR(0, 722, __pyx_L3_error)
5083 if (likely((values[10] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_confidence_level)) != 0)) kw_args--;
5085 __Pyx_RaiseArgtupleInvalid(
"_hutchinson_method_float", 1, 15, 15, 10); __PYX_ERR(0, 722, __pyx_L3_error)
5089 if (likely((values[11] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_outlier_significance_level)) != 0)) kw_args--;
5091 __Pyx_RaiseArgtupleInvalid(
"_hutchinson_method_float", 1, 15, 15, 11); __PYX_ERR(0, 722, __pyx_L3_error)
5095 if (likely((values[12] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_solver_tol)) != 0)) kw_args--;
5097 __Pyx_RaiseArgtupleInvalid(
"_hutchinson_method_float", 1, 15, 15, 12); __PYX_ERR(0, 722, __pyx_L3_error)
5101 if (likely((values[13] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_orthogonalize)) != 0)) kw_args--;
5103 __Pyx_RaiseArgtupleInvalid(
"_hutchinson_method_float", 1, 15, 15, 13); __PYX_ERR(0, 722, __pyx_L3_error)
5107 if (likely((values[14] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_num_threads)) != 0)) kw_args--;
5109 __Pyx_RaiseArgtupleInvalid(
"_hutchinson_method_float", 1, 15, 15, 14); __PYX_ERR(0, 722, __pyx_L3_error)
5112 if (unlikely(kw_args > 0)) {
5113 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"_hutchinson_method_float") < 0)) __PYX_ERR(0, 722, __pyx_L3_error)
5115 }
else if (PyTuple_GET_SIZE(__pyx_args) != 15) {
5116 goto __pyx_L5_argtuple_error;
5118 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5119 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5120 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5121 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
5122 values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
5123 values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
5124 values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
5125 values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
5126 values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
5127 values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
5128 values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
5129 values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
5130 values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
5131 values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
5132 values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
5134 __pyx_v_A = values[0];
5135 __pyx_v_B = values[1];
5136 __pyx_v_C = values[2];
5137 __pyx_v_gram = values[3];
5138 __pyx_v_p = values[4];
5139 __pyx_v_assume_matrix = values[5];
5140 __pyx_v_min_num_samples = values[6];
5141 __pyx_v_max_num_samples = values[7];
5142 __pyx_v_error_atol = values[8];
5143 __pyx_v_error_rtol = values[9];
5144 __pyx_v_confidence_level = values[10];
5145 __pyx_v_outlier_significance_level = values[11];
5146 __pyx_v_solver_tol = values[12];
5147 __pyx_v_orthogonalize = values[13];
5148 __pyx_v_num_threads = values[14];
5150 goto __pyx_L4_argument_unpacking_done;
5151 __pyx_L5_argtuple_error:;
5152 __Pyx_RaiseArgtupleInvalid(
"_hutchinson_method_float", 1, 15, 15, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 722, __pyx_L3_error)
5154 __Pyx_AddTraceback(
"imate.traceinv._hutchinson_method._hutchinson_method_float", __pyx_clineno, __pyx_lineno, __pyx_filename);
5155 __Pyx_RefNannyFinishContext();
5157 __pyx_L4_argument_unpacking_done:;
5158 __pyx_r = __pyx_pf_5imate_8traceinv_18_hutchinson_method_2_hutchinson_method_float(__pyx_self, __pyx_v_A, __pyx_v_B, __pyx_v_C, __pyx_v_gram, __pyx_v_p, __pyx_v_assume_matrix, __pyx_v_min_num_samples, __pyx_v_max_num_samples, __pyx_v_error_atol, __pyx_v_error_rtol, __pyx_v_confidence_level, __pyx_v_outlier_significance_level, __pyx_v_solver_tol, __pyx_v_orthogonalize, __pyx_v_num_threads);
5161 __Pyx_RefNannyFinishContext();
5165 static PyObject *__pyx_pf_5imate_8traceinv_18_hutchinson_method_2_hutchinson_method_float(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_B, PyObject *__pyx_v_C, PyObject *__pyx_v_gram, PyObject *__pyx_v_p, PyObject *__pyx_v_assume_matrix, PyObject *__pyx_v_min_num_samples, PyObject *__pyx_v_max_num_samples, PyObject *__pyx_v_error_atol, PyObject *__pyx_v_error_rtol, PyObject *__pyx_v_confidence_level, PyObject *__pyx_v_outlier_significance_level, PyObject *__pyx_v_solver_tol, PyObject *__pyx_v_orthogonalize, PyObject *__pyx_v_num_threads) {
5166 PyObject *__pyx_v_vector_size = NULL;
5167 PyObject *__pyx_v_E = NULL;
5168 __Pyx_memviewslice __pyx_v_memoryview_E = { 0, 0, { 0 }, { 0 }, { 0 } };
5170 PyObject *__pyx_v_init_tot_wall_time = NULL;
5171 PyObject *__pyx_v_init_cpu_proc_time = NULL;
5172 PyObject *__pyx_v_samples = NULL;
5173 PyObject *__pyx_v_processed_samples_indices = NULL;
5174 int __pyx_v_num_processed_samples;
5175 int __pyx_v_num_samples_used;
5176 int __pyx_v_converged;
5177 PyObject *__pyx_v_init_alg_wall_time = NULL;
5178 PyObject *__pyx_v_AtA = NULL;
5179 PyObject *__pyx_v_i = NULL;
5180 PyObject *__pyx_v_alg_wall_time = NULL;
5181 PyObject *__pyx_v_trace = NULL;
5182 PyObject *__pyx_v_error = NULL;
5183 PyObject *__pyx_v_num_outliers = NULL;
5184 PyObject *__pyx_v_tot_wall_time = NULL;
5185 PyObject *__pyx_v_cpu_proc_time = NULL;
5186 PyObject *__pyx_r = NULL;
5187 __Pyx_TraceDeclarations
5188 __Pyx_RefNannyDeclarations
5189 PyObject *__pyx_t_1 = NULL;
5190 PyObject *__pyx_t_2 = NULL;
5191 PyObject *__pyx_t_3 = NULL;
5192 PyObject *__pyx_t_4 = NULL;
5193 PyObject *__pyx_t_5 = NULL;
5194 __Pyx_memviewslice __pyx_t_6 = { 0, 0, { 0 }, { 0 }, { 0 } };
5195 Py_ssize_t __pyx_t_7;
5196 Py_ssize_t __pyx_t_8;
5197 __pyx_t_5imate_12_definitions_5types_LongIndexType __pyx_t_9;
5198 __pyx_t_5imate_12_definitions_5types_IndexType __pyx_t_10;
5199 __pyx_t_5imate_12_definitions_5types_IndexType __pyx_t_11;
5200 __pyx_t_5imate_12_definitions_5types_IndexType __pyx_t_12;
5204 Py_ssize_t __pyx_t_16;
5205 PyObject *(*__pyx_t_17)(PyObject *);
5208 PyObject *__pyx_t_20 = NULL;
5209 PyObject *(*__pyx_t_21)(PyObject *);
5211 int __pyx_lineno = 0;
5212 const char *__pyx_filename = NULL;
5213 int __pyx_clineno = 0;
5214 __Pyx_TraceFrameInit(__pyx_codeobj__3)
5215 __Pyx_RefNannySetupContext(
"_hutchinson_method_float", 0);
5216 __Pyx_TraceCall(
"_hutchinson_method_float", __pyx_f[0], 722, 0, __PYX_ERR(0, 722, __pyx_L1_error));
5225 __Pyx_TraceLine(742,0,__PYX_ERR(0, 742, __pyx_L1_error))
5226 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_shape);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 742, __pyx_L1_error)
5227 __Pyx_GOTREF(__pyx_t_1);
5228 __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0,
long, 1, __Pyx_PyInt_From_long, 0, 0, 0);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 742, __pyx_L1_error)
5229 __Pyx_GOTREF(__pyx_t_2);
5230 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5231 __pyx_v_vector_size = __pyx_t_2;
5241 __Pyx_TraceLine(746,0,__PYX_ERR(0, 746, __pyx_L1_error))
5242 __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_numpy);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 746, __pyx_L1_error)
5243 __Pyx_GOTREF(__pyx_t_2);
5244 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 746, __pyx_L1_error)
5245 __Pyx_GOTREF(__pyx_t_1);
5246 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5247 __pyx_t_2 = PyTuple_New(2);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 746, __pyx_L1_error)
5248 __Pyx_GOTREF(__pyx_t_2);
5249 __Pyx_INCREF(__pyx_v_vector_size);
5250 __Pyx_GIVEREF(__pyx_v_vector_size);
5251 PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_vector_size);
5252 __Pyx_INCREF(__pyx_v_max_num_samples);
5253 __Pyx_GIVEREF(__pyx_v_max_num_samples);
5254 PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_max_num_samples);
5255 __pyx_t_3 = PyTuple_New(1);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 746, __pyx_L1_error)
5256 __Pyx_GOTREF(__pyx_t_3);
5257 __Pyx_GIVEREF(__pyx_t_2);
5258 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
5260 __pyx_t_2 = __Pyx_PyDict_NewPresized(2);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 746, __pyx_L1_error)
5261 __Pyx_GOTREF(__pyx_t_2);
5262 __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_numpy);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 746, __pyx_L1_error)
5263 __Pyx_GOTREF(__pyx_t_4);
5264 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_float32);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 746, __pyx_L1_error)
5265 __Pyx_GOTREF(__pyx_t_5);
5266 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5267 if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_5) < 0) __PYX_ERR(0, 746, __pyx_L1_error)
5268 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
5269 if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_order, __pyx_n_u_F) < 0) __PYX_ERR(0, 746, __pyx_L1_error)
5270 __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_2);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 746, __pyx_L1_error)
5271 __Pyx_GOTREF(__pyx_t_5);
5272 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5273 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5274 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5275 __pyx_v_E = __pyx_t_5;
5285 __Pyx_TraceLine(750,0,__PYX_ERR(0, 750, __pyx_L1_error))
5286 __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_dcd__float(__pyx_v_E, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 750, __pyx_L1_error)
5287 __pyx_v_memoryview_E = __pyx_t_6;
5288 __pyx_t_6.memview = NULL;
5289 __pyx_t_6.data = NULL;
5298 __Pyx_TraceLine(751,0,__PYX_ERR(0, 751, __pyx_L1_error))
5301 __pyx_v_cE = (&(*((
float *) ( (( ((
char *) (((
float *) __pyx_v_memoryview_E.data) + __pyx_t_7)) ) + __pyx_t_8 * __pyx_v_memoryview_E.strides[1]) ))));
5310 __Pyx_TraceLine(753,0,__PYX_ERR(0, 753, __pyx_L1_error))
5311 __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_time);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 753, __pyx_L1_error)
5312 __Pyx_GOTREF(__pyx_t_2);
5313 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_perf_counter);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 753, __pyx_L1_error)
5314 __Pyx_GOTREF(__pyx_t_3);
5315 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5317 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
5318 __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
5319 if (likely(__pyx_t_2)) {
5320 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
5321 __Pyx_INCREF(__pyx_t_2);
5322 __Pyx_INCREF(
function);
5323 __Pyx_DECREF_SET(__pyx_t_3,
function);
5326 __pyx_t_5 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
5327 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
5328 if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 753, __pyx_L1_error)
5329 __Pyx_GOTREF(__pyx_t_5);
5330 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5331 __pyx_v_init_tot_wall_time = __pyx_t_5;
5341 __Pyx_TraceLine(754,0,__PYX_ERR(0, 754, __pyx_L1_error))
5342 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_time);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 754, __pyx_L1_error)
5343 __Pyx_GOTREF(__pyx_t_3);
5344 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_process_time);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 754, __pyx_L1_error)
5345 __Pyx_GOTREF(__pyx_t_2);
5346 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5348 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
5349 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
5350 if (likely(__pyx_t_3)) {
5351 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_2);
5352 __Pyx_INCREF(__pyx_t_3);
5353 __Pyx_INCREF(
function);
5354 __Pyx_DECREF_SET(__pyx_t_2,
function);
5357 __pyx_t_5 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
5358 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
5359 if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 754, __pyx_L1_error)
5360 __Pyx_GOTREF(__pyx_t_5);
5361 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5362 __pyx_v_init_cpu_proc_time = __pyx_t_5;
5372 __Pyx_TraceLine(757,0,__PYX_ERR(0, 757, __pyx_L1_error))
5373 __pyx_t_9 = __Pyx_PyInt_As_int(__pyx_v_vector_size);
if (unlikely((__pyx_t_9 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 757, __pyx_L1_error)
5374 __pyx_t_10 = __Pyx_PyInt_As_int(__pyx_v_max_num_samples);
if (unlikely((__pyx_t_10 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 757, __pyx_L1_error)
5383 __Pyx_TraceLine(758,0,__PYX_ERR(0, 758, __pyx_L1_error))
5384 __pyx_t_5 = __Pyx_PyNumber_Int(__pyx_v_orthogonalize);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 758, __pyx_L1_error)
5385 __Pyx_GOTREF(__pyx_t_5);
5386 __pyx_t_11 = __Pyx_PyInt_As_int(__pyx_t_5);
if (unlikely((__pyx_t_11 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 758, __pyx_L1_error)
5387 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
5388 __pyx_t_12 = __Pyx_PyInt_As_int(__pyx_v_num_threads);
if (unlikely((__pyx_t_12 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 758, __pyx_L1_error)
5397 __Pyx_TraceLine(757,0,__PYX_ERR(0, 757, __pyx_L1_error))
5398 __pyx_fuse_0__pyx_f_5imate_15_linear_algebra_14random_vectors_generate_random_column_vectors(__pyx_v_cE, __pyx_t_9, __pyx_t_10, __pyx_t_11, __pyx_t_12);
5407 __Pyx_TraceLine(760,0,__PYX_ERR(0, 760, __pyx_L1_error))
5408 __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_numpy);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 760, __pyx_L1_error)
5409 __Pyx_GOTREF(__pyx_t_5);
5410 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_zeros);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 760, __pyx_L1_error)
5411 __Pyx_GOTREF(__pyx_t_2);
5412 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
5413 __pyx_t_5 = PyTuple_New(1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 760, __pyx_L1_error)
5414 __Pyx_GOTREF(__pyx_t_5);
5415 __Pyx_INCREF(__pyx_v_max_num_samples);
5416 __Pyx_GIVEREF(__pyx_v_max_num_samples);
5417 PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_max_num_samples);
5418 __pyx_t_3 = PyTuple_New(1);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 760, __pyx_L1_error)
5419 __Pyx_GOTREF(__pyx_t_3);
5420 __Pyx_GIVEREF(__pyx_t_5);
5421 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5);
5423 __pyx_t_5 = __Pyx_PyDict_NewPresized(1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 760, __pyx_L1_error)
5424 __Pyx_GOTREF(__pyx_t_5);
5425 __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_numpy);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 760, __pyx_L1_error)
5426 __Pyx_GOTREF(__pyx_t_1);
5427 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_float32);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 760, __pyx_L1_error)
5428 __Pyx_GOTREF(__pyx_t_4);
5429 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5430 if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_t_4) < 0) __PYX_ERR(0, 760, __pyx_L1_error)
5431 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5432 __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_5);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 760, __pyx_L1_error)
5433 __Pyx_GOTREF(__pyx_t_4);
5434 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5435 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5436 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
5437 __pyx_v_samples = __pyx_t_4;
5447 __Pyx_TraceLine(761,0,__PYX_ERR(0, 761, __pyx_L1_error))
5448 __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_numpy);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 761, __pyx_L1_error)
5449 __Pyx_GOTREF(__pyx_t_4);
5450 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_zeros);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 761, __pyx_L1_error)
5451 __Pyx_GOTREF(__pyx_t_5);
5452 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5453 __pyx_t_4 = PyTuple_New(1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 761, __pyx_L1_error)
5454 __Pyx_GOTREF(__pyx_t_4);
5455 __Pyx_INCREF(__pyx_v_max_num_samples);
5456 __Pyx_GIVEREF(__pyx_v_max_num_samples);
5457 PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_max_num_samples);
5458 __pyx_t_3 = PyTuple_New(1);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 761, __pyx_L1_error)
5459 __Pyx_GOTREF(__pyx_t_3);
5460 __Pyx_GIVEREF(__pyx_t_4);
5461 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
5463 __pyx_t_4 = __Pyx_PyDict_NewPresized(1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 761, __pyx_L1_error)
5464 __Pyx_GOTREF(__pyx_t_4);
5465 if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, ((PyObject *)(&PyInt_Type))) < 0) __PYX_ERR(0, 761, __pyx_L1_error)
5466 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_3, __pyx_t_4);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 761, __pyx_L1_error)
5467 __Pyx_GOTREF(__pyx_t_2);
5468 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
5469 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5470 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5471 __pyx_v_processed_samples_indices = __pyx_t_2;
5481 __Pyx_TraceLine(762,0,__PYX_ERR(0, 762, __pyx_L1_error))
5482 __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_numpy);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 762, __pyx_L1_error)
5483 __Pyx_GOTREF(__pyx_t_2);
5484 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_nan);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 762, __pyx_L1_error)
5485 __Pyx_GOTREF(__pyx_t_4);
5486 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5487 if (__Pyx_PyObject_SetSlice(__pyx_v_samples, __pyx_t_4, 0, 0, NULL, NULL, &__pyx_slice__4, 0, 0, 0) < 0) __PYX_ERR(0, 762, __pyx_L1_error)
5488 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5497 __Pyx_TraceLine(763,0,__PYX_ERR(0, 763, __pyx_L1_error))
5498 __pyx_v_num_processed_samples = 0;
5507 __Pyx_TraceLine(764,0,__PYX_ERR(0, 764, __pyx_L1_error))
5508 __pyx_v_num_samples_used = 0;
5517 __Pyx_TraceLine(765,0,__PYX_ERR(0, 765, __pyx_L1_error))
5518 __pyx_v_converged = 0;
5527 __Pyx_TraceLine(767,0,__PYX_ERR(0, 767, __pyx_L1_error))
5528 __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_time);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 767, __pyx_L1_error)
5529 __Pyx_GOTREF(__pyx_t_2);
5530 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_perf_counter);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 767, __pyx_L1_error)
5531 __Pyx_GOTREF(__pyx_t_3);
5532 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5534 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
5535 __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
5536 if (likely(__pyx_t_2)) {
5537 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
5538 __Pyx_INCREF(__pyx_t_2);
5539 __Pyx_INCREF(
function);
5540 __Pyx_DECREF_SET(__pyx_t_3,
function);
5543 __pyx_t_4 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
5544 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
5545 if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 767, __pyx_L1_error)
5546 __Pyx_GOTREF(__pyx_t_4);
5547 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5548 __pyx_v_init_alg_wall_time = __pyx_t_4;
5558 __Pyx_TraceLine(770,0,__PYX_ERR(0, 770, __pyx_L1_error))
5559 __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_v_gram);
if (unlikely(__pyx_t_13 < 0)) __PYX_ERR(0, 770, __pyx_L1_error)
5569 __Pyx_TraceLine(771,0,__PYX_ERR(0, 771, __pyx_L1_error))
5570 __pyx_t_4 = __Pyx_PyInt_EqObjC(__pyx_v_p, __pyx_int_1, 1, 0);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 771, __pyx_L1_error)
5571 __Pyx_GOTREF(__pyx_t_4);
5572 __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_4);
if (unlikely(__pyx_t_14 < 0)) __PYX_ERR(0, 771, __pyx_L1_error)
5573 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5576 __pyx_t_13 = __pyx_t_14;
5577 goto __pyx_L5_bool_binop_done;
5579 __pyx_t_14 = (__pyx_v_B == Py_None);
5580 __pyx_t_15 = (__pyx_t_14 != 0);
5583 __pyx_t_13 = __pyx_t_15;
5584 goto __pyx_L5_bool_binop_done;
5586 __pyx_t_15 = (__pyx_v_C == Py_None);
5587 __pyx_t_14 = (__pyx_t_15 != 0);
5588 __pyx_t_13 = __pyx_t_14;
5589 __pyx_L5_bool_binop_done:;
5599 __Pyx_TraceLine(773,0,__PYX_ERR(0, 773, __pyx_L1_error))
5600 __Pyx_INCREF(Py_None);
5601 __pyx_v_AtA = Py_None;
5620 __Pyx_TraceLine(775,0,__PYX_ERR(0, 775, __pyx_L1_error))
5622 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_T);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 775, __pyx_L1_error)
5623 __Pyx_GOTREF(__pyx_t_4);
5624 __pyx_t_3 = __Pyx_PyNumber_MatrixMultiply(__pyx_t_4, __pyx_v_A);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 775, __pyx_L1_error)
5625 __Pyx_GOTREF(__pyx_t_3);
5626 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5627 __pyx_v_AtA = __pyx_t_3;
5649 __Pyx_TraceLine(777,0,__PYX_ERR(0, 777, __pyx_L1_error))
5651 __Pyx_INCREF(Py_None);
5652 __pyx_v_AtA = Py_None;
5663 __Pyx_TraceLine(780,0,__PYX_ERR(0, 780, __pyx_L1_error))
5664 __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_v_max_num_samples);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 780, __pyx_L1_error)
5665 __Pyx_GOTREF(__pyx_t_3);
5666 if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) {
5667 __pyx_t_4 = __pyx_t_3; __Pyx_INCREF(__pyx_t_4); __pyx_t_16 = 0;
5670 __pyx_t_16 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_3);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 780, __pyx_L1_error)
5671 __Pyx_GOTREF(__pyx_t_4);
5672 __pyx_t_17 = Py_TYPE(__pyx_t_4)->tp_iternext;
if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 780, __pyx_L1_error)
5674 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5676 if (likely(!__pyx_t_17)) {
5677 if (likely(PyList_CheckExact(__pyx_t_4))) {
5678 if (__pyx_t_16 >= PyList_GET_SIZE(__pyx_t_4))
break;
5679 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
5680 __pyx_t_3 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_16); __Pyx_INCREF(__pyx_t_3); __pyx_t_16++;
if (unlikely(0 < 0)) __PYX_ERR(0, 780, __pyx_L1_error)
5682 __pyx_t_3 = PySequence_ITEM(__pyx_t_4, __pyx_t_16); __pyx_t_16++;
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 780, __pyx_L1_error)
5683 __Pyx_GOTREF(__pyx_t_3);
5686 if (__pyx_t_16 >= PyTuple_GET_SIZE(__pyx_t_4))
break;
5687 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
5688 __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_16); __Pyx_INCREF(__pyx_t_3); __pyx_t_16++;
if (unlikely(0 < 0)) __PYX_ERR(0, 780, __pyx_L1_error)
5690 __pyx_t_3 = PySequence_ITEM(__pyx_t_4, __pyx_t_16); __pyx_t_16++;
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 780, __pyx_L1_error)
5691 __Pyx_GOTREF(__pyx_t_3);
5695 __pyx_t_3 = __pyx_t_17(__pyx_t_4);
5696 if (unlikely(!__pyx_t_3)) {
5697 PyObject* exc_type = PyErr_Occurred();
5699 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
5700 else __PYX_ERR(0, 780, __pyx_L1_error)
5704 __Pyx_GOTREF(__pyx_t_3);
5706 __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_3);
5716 __Pyx_TraceLine(782,0,__PYX_ERR(0, 782, __pyx_L1_error))
5717 __pyx_t_13 = ((__pyx_v_converged == 0) != 0);
5727 __Pyx_TraceLine(786,0,__PYX_ERR(0, 786, __pyx_L1_error))
5728 __pyx_t_3 = PyTuple_New(2);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 786, __pyx_L1_error)
5729 __Pyx_GOTREF(__pyx_t_3);
5730 __Pyx_INCREF(__pyx_slice__4);
5731 __Pyx_GIVEREF(__pyx_slice__4);
5732 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_slice__4);
5733 __Pyx_INCREF(__pyx_v_i);
5734 __Pyx_GIVEREF(__pyx_v_i);
5735 PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_i);
5736 __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_v_E, __pyx_t_3);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 786, __pyx_L1_error)
5737 __Pyx_GOTREF(__pyx_t_2);
5738 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5747 __Pyx_TraceLine(785,0,__PYX_ERR(0, 785, __pyx_L1_error))
5748 __pyx_t_18 = __pyx_f_5imate_8traceinv_18_hutchinson_method__stochastic_trace_estimator_float(__pyx_v_A, __pyx_v_AtA, __pyx_v_B, __pyx_v_C, __pyx_t_2, __pyx_v_gram, __pyx_v_p, __pyx_v_assume_matrix, __pyx_v_solver_tol);
if (unlikely(__pyx_t_18 == ((
float)-1) && PyErr_Occurred())) __PYX_ERR(0, 785, __pyx_L1_error)
5749 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5750 __pyx_t_2 = PyFloat_FromDouble(__pyx_t_18);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 785, __pyx_L1_error)
5751 __Pyx_GOTREF(__pyx_t_2);
5752 if (unlikely(PyObject_SetItem(__pyx_v_samples, __pyx_v_i, __pyx_t_2) < 0)) __PYX_ERR(0, 785, __pyx_L1_error)
5753 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5762 __Pyx_TraceLine(789,0,__PYX_ERR(0, 789, __pyx_L1_error))
5763 if (unlikely(__Pyx_SetItemInt(__pyx_v_processed_samples_indices, __pyx_v_num_processed_samples, __pyx_v_i,
int, 1, __Pyx_PyInt_From_int, 0, 0, 0) < 0)) __PYX_ERR(0, 789, __pyx_L1_error)
5772 __Pyx_TraceLine(790,0,__PYX_ERR(0, 790, __pyx_L1_error))
5773 __pyx_v_num_processed_samples = (__pyx_v_num_processed_samples + 1);
5782 __Pyx_TraceLine(795,0,__PYX_ERR(0, 795, __pyx_L1_error))
5783 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_check_convergence);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 795, __pyx_L1_error)
5784 __Pyx_GOTREF(__pyx_t_3);
5793 __Pyx_TraceLine(797,0,__PYX_ERR(0, 797, __pyx_L1_error))
5794 __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_num_processed_samples);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 797, __pyx_L1_error)
5795 __Pyx_GOTREF(__pyx_t_5);
5804 __Pyx_TraceLine(798,0,__PYX_ERR(0, 798, __pyx_L1_error))
5807 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
5808 __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
5809 if (likely(__pyx_t_1)) {
5810 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
5811 __Pyx_INCREF(__pyx_t_1);
5812 __Pyx_INCREF(
function);
5813 __Pyx_DECREF_SET(__pyx_t_3,
function);
5817 #if CYTHON_FAST_PYCALL
5818 if (PyFunction_Check(__pyx_t_3)) {
5819 PyObject *__pyx_temp[8] = {__pyx_t_1, __pyx_v_samples, __pyx_v_min_num_samples, __pyx_v_processed_samples_indices, __pyx_t_5, __pyx_v_confidence_level, __pyx_v_error_atol, __pyx_v_error_rtol};
5820 __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_19, 7+__pyx_t_19);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 795, __pyx_L1_error)
5821 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
5822 __Pyx_GOTREF(__pyx_t_2);
5823 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
5826 #if CYTHON_FAST_PYCCALL
5827 if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
5828 PyObject *__pyx_temp[8] = {__pyx_t_1, __pyx_v_samples, __pyx_v_min_num_samples, __pyx_v_processed_samples_indices, __pyx_t_5, __pyx_v_confidence_level, __pyx_v_error_atol, __pyx_v_error_rtol};
5829 __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_19, 7+__pyx_t_19);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 795, __pyx_L1_error)
5830 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
5831 __Pyx_GOTREF(__pyx_t_2);
5832 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
5836 __pyx_t_20 = PyTuple_New(7+__pyx_t_19);
if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 795, __pyx_L1_error)
5837 __Pyx_GOTREF(__pyx_t_20);
5839 __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_20, 0, __pyx_t_1); __pyx_t_1 = NULL;
5841 __Pyx_INCREF(__pyx_v_samples);
5842 __Pyx_GIVEREF(__pyx_v_samples);
5843 PyTuple_SET_ITEM(__pyx_t_20, 0+__pyx_t_19, __pyx_v_samples);
5844 __Pyx_INCREF(__pyx_v_min_num_samples);
5845 __Pyx_GIVEREF(__pyx_v_min_num_samples);
5846 PyTuple_SET_ITEM(__pyx_t_20, 1+__pyx_t_19, __pyx_v_min_num_samples);
5847 __Pyx_INCREF(__pyx_v_processed_samples_indices);
5848 __Pyx_GIVEREF(__pyx_v_processed_samples_indices);
5849 PyTuple_SET_ITEM(__pyx_t_20, 2+__pyx_t_19, __pyx_v_processed_samples_indices);
5850 __Pyx_GIVEREF(__pyx_t_5);
5851 PyTuple_SET_ITEM(__pyx_t_20, 3+__pyx_t_19, __pyx_t_5);
5852 __Pyx_INCREF(__pyx_v_confidence_level);
5853 __Pyx_GIVEREF(__pyx_v_confidence_level);
5854 PyTuple_SET_ITEM(__pyx_t_20, 4+__pyx_t_19, __pyx_v_confidence_level);
5855 __Pyx_INCREF(__pyx_v_error_atol);
5856 __Pyx_GIVEREF(__pyx_v_error_atol);
5857 PyTuple_SET_ITEM(__pyx_t_20, 5+__pyx_t_19, __pyx_v_error_atol);
5858 __Pyx_INCREF(__pyx_v_error_rtol);
5859 __Pyx_GIVEREF(__pyx_v_error_rtol);
5860 PyTuple_SET_ITEM(__pyx_t_20, 6+__pyx_t_19, __pyx_v_error_rtol);
5862 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_20, NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 795, __pyx_L1_error)
5863 __Pyx_GOTREF(__pyx_t_2);
5864 __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
5866 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5867 if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) {
5868 PyObject* sequence = __pyx_t_2;
5869 Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
5870 if (unlikely(size != 2)) {
5871 if (size > 2) __Pyx_RaiseTooManyValuesError(2);
5872 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
5873 __PYX_ERR(0, 795, __pyx_L1_error)
5875 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
5876 if (likely(PyTuple_CheckExact(sequence))) {
5877 __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0);
5878 __pyx_t_20 = PyTuple_GET_ITEM(sequence, 1);
5880 __pyx_t_3 = PyList_GET_ITEM(sequence, 0);
5881 __pyx_t_20 = PyList_GET_ITEM(sequence, 1);
5883 __Pyx_INCREF(__pyx_t_3);
5884 __Pyx_INCREF(__pyx_t_20);
5886 __pyx_t_3 = PySequence_ITEM(sequence, 0);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 795, __pyx_L1_error)
5887 __Pyx_GOTREF(__pyx_t_3);
5888 __pyx_t_20 = PySequence_ITEM(sequence, 1);
if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 795, __pyx_L1_error)
5889 __Pyx_GOTREF(__pyx_t_20);
5891 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5893 Py_ssize_t index = -1;
5894 __pyx_t_5 = PyObject_GetIter(__pyx_t_2);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 795, __pyx_L1_error)
5895 __Pyx_GOTREF(__pyx_t_5);
5896 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5897 __pyx_t_21 = Py_TYPE(__pyx_t_5)->tp_iternext;
5898 index = 0; __pyx_t_3 = __pyx_t_21(__pyx_t_5);
if (unlikely(!__pyx_t_3))
goto __pyx_L11_unpacking_failed;
5899 __Pyx_GOTREF(__pyx_t_3);
5900 index = 1; __pyx_t_20 = __pyx_t_21(__pyx_t_5);
if (unlikely(!__pyx_t_20))
goto __pyx_L11_unpacking_failed;
5901 __Pyx_GOTREF(__pyx_t_20);
5902 if (__Pyx_IternextUnpackEndCheck(__pyx_t_21(__pyx_t_5), 2) < 0) __PYX_ERR(0, 795, __pyx_L1_error)
5904 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
5905 goto __pyx_L12_unpacking_done;
5906 __pyx_L11_unpacking_failed:;
5907 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
5909 if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
5910 __PYX_ERR(0, 795, __pyx_L1_error)
5911 __pyx_L12_unpacking_done:;
5921 __Pyx_TraceLine(795,0,__PYX_ERR(0, 795, __pyx_L1_error))
5922 __pyx_t_19 = __Pyx_PyInt_As_int(__pyx_t_3);
if (unlikely((__pyx_t_19 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 795, __pyx_L1_error)
5923 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5924 __pyx_t_22 = __Pyx_PyInt_As_int(__pyx_t_20);
if (unlikely((__pyx_t_22 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 795, __pyx_L1_error)
5925 __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
5926 __pyx_v_converged = __pyx_t_19;
5927 __pyx_v_num_samples_used = __pyx_t_22;
5945 __Pyx_TraceLine(780,0,__PYX_ERR(0, 780, __pyx_L1_error))
5947 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5956 __Pyx_TraceLine(800,0,__PYX_ERR(0, 800, __pyx_L1_error))
5957 __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_time);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 800, __pyx_L1_error)
5958 __Pyx_GOTREF(__pyx_t_2);
5959 __pyx_t_20 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_perf_counter);
if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 800, __pyx_L1_error)
5960 __Pyx_GOTREF(__pyx_t_20);
5961 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5963 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_20))) {
5964 __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_20);
5965 if (likely(__pyx_t_2)) {
5966 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_20);
5967 __Pyx_INCREF(__pyx_t_2);
5968 __Pyx_INCREF(
function);
5969 __Pyx_DECREF_SET(__pyx_t_20,
function);
5972 __pyx_t_4 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_20, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_20);
5973 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
5974 if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 800, __pyx_L1_error)
5975 __Pyx_GOTREF(__pyx_t_4);
5976 __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
5977 __pyx_t_20 = PyNumber_Subtract(__pyx_t_4, __pyx_v_init_alg_wall_time);
if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 800, __pyx_L1_error)
5978 __Pyx_GOTREF(__pyx_t_20);
5979 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5980 __pyx_v_alg_wall_time = __pyx_t_20;
5990 __Pyx_TraceLine(802,0,__PYX_ERR(0, 802, __pyx_L1_error))
5991 __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_average_estimates);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 802, __pyx_L1_error)
5992 __Pyx_GOTREF(__pyx_t_4);
6001 __Pyx_TraceLine(804,0,__PYX_ERR(0, 804, __pyx_L1_error))
6002 __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_num_samples_used);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 804, __pyx_L1_error)
6003 __Pyx_GOTREF(__pyx_t_2);
6006 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
6007 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
6008 if (likely(__pyx_t_3)) {
6009 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_4);
6010 __Pyx_INCREF(__pyx_t_3);
6011 __Pyx_INCREF(
function);
6012 __Pyx_DECREF_SET(__pyx_t_4,
function);
6016 #if CYTHON_FAST_PYCALL
6017 if (PyFunction_Check(__pyx_t_4)) {
6018 PyObject *__pyx_temp[7] = {__pyx_t_3, __pyx_v_confidence_level, __pyx_v_outlier_significance_level, __pyx_v_max_num_samples, __pyx_t_2, __pyx_v_processed_samples_indices, __pyx_v_samples};
6019 __pyx_t_20 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_22, 6+__pyx_t_22);
if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 802, __pyx_L1_error)
6020 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
6021 __Pyx_GOTREF(__pyx_t_20);
6022 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6025 #if CYTHON_FAST_PYCCALL
6026 if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
6027 PyObject *__pyx_temp[7] = {__pyx_t_3, __pyx_v_confidence_level, __pyx_v_outlier_significance_level, __pyx_v_max_num_samples, __pyx_t_2, __pyx_v_processed_samples_indices, __pyx_v_samples};
6028 __pyx_t_20 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_22, 6+__pyx_t_22);
if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 802, __pyx_L1_error)
6029 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
6030 __Pyx_GOTREF(__pyx_t_20);
6031 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6035 __pyx_t_5 = PyTuple_New(6+__pyx_t_22);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 802, __pyx_L1_error)
6036 __Pyx_GOTREF(__pyx_t_5);
6038 __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL;
6040 __Pyx_INCREF(__pyx_v_confidence_level);
6041 __Pyx_GIVEREF(__pyx_v_confidence_level);
6042 PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_22, __pyx_v_confidence_level);
6043 __Pyx_INCREF(__pyx_v_outlier_significance_level);
6044 __Pyx_GIVEREF(__pyx_v_outlier_significance_level);
6045 PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_22, __pyx_v_outlier_significance_level);
6046 __Pyx_INCREF(__pyx_v_max_num_samples);
6047 __Pyx_GIVEREF(__pyx_v_max_num_samples);
6048 PyTuple_SET_ITEM(__pyx_t_5, 2+__pyx_t_22, __pyx_v_max_num_samples);
6049 __Pyx_GIVEREF(__pyx_t_2);
6050 PyTuple_SET_ITEM(__pyx_t_5, 3+__pyx_t_22, __pyx_t_2);
6051 __Pyx_INCREF(__pyx_v_processed_samples_indices);
6052 __Pyx_GIVEREF(__pyx_v_processed_samples_indices);
6053 PyTuple_SET_ITEM(__pyx_t_5, 4+__pyx_t_22, __pyx_v_processed_samples_indices);
6054 __Pyx_INCREF(__pyx_v_samples);
6055 __Pyx_GIVEREF(__pyx_v_samples);
6056 PyTuple_SET_ITEM(__pyx_t_5, 5+__pyx_t_22, __pyx_v_samples);
6058 __pyx_t_20 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, NULL);
if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 802, __pyx_L1_error)
6059 __Pyx_GOTREF(__pyx_t_20);
6060 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
6062 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6063 if ((likely(PyTuple_CheckExact(__pyx_t_20))) || (PyList_CheckExact(__pyx_t_20))) {
6064 PyObject* sequence = __pyx_t_20;
6065 Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
6066 if (unlikely(size != 3)) {
6067 if (size > 3) __Pyx_RaiseTooManyValuesError(3);
6068 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
6069 __PYX_ERR(0, 802, __pyx_L1_error)
6071 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
6072 if (likely(PyTuple_CheckExact(sequence))) {
6073 __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0);
6074 __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1);
6075 __pyx_t_2 = PyTuple_GET_ITEM(sequence, 2);
6077 __pyx_t_4 = PyList_GET_ITEM(sequence, 0);
6078 __pyx_t_5 = PyList_GET_ITEM(sequence, 1);
6079 __pyx_t_2 = PyList_GET_ITEM(sequence, 2);
6081 __Pyx_INCREF(__pyx_t_4);
6082 __Pyx_INCREF(__pyx_t_5);
6083 __Pyx_INCREF(__pyx_t_2);
6085 __pyx_t_4 = PySequence_ITEM(sequence, 0);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 802, __pyx_L1_error)
6086 __Pyx_GOTREF(__pyx_t_4);
6087 __pyx_t_5 = PySequence_ITEM(sequence, 1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 802, __pyx_L1_error)
6088 __Pyx_GOTREF(__pyx_t_5);
6089 __pyx_t_2 = PySequence_ITEM(sequence, 2);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 802, __pyx_L1_error)
6090 __Pyx_GOTREF(__pyx_t_2);
6092 __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
6094 Py_ssize_t index = -1;
6095 __pyx_t_3 = PyObject_GetIter(__pyx_t_20);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 802, __pyx_L1_error)
6096 __Pyx_GOTREF(__pyx_t_3);
6097 __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
6098 __pyx_t_21 = Py_TYPE(__pyx_t_3)->tp_iternext;
6099 index = 0; __pyx_t_4 = __pyx_t_21(__pyx_t_3);
if (unlikely(!__pyx_t_4))
goto __pyx_L13_unpacking_failed;
6100 __Pyx_GOTREF(__pyx_t_4);
6101 index = 1; __pyx_t_5 = __pyx_t_21(__pyx_t_3);
if (unlikely(!__pyx_t_5))
goto __pyx_L13_unpacking_failed;
6102 __Pyx_GOTREF(__pyx_t_5);
6103 index = 2; __pyx_t_2 = __pyx_t_21(__pyx_t_3);
if (unlikely(!__pyx_t_2))
goto __pyx_L13_unpacking_failed;
6104 __Pyx_GOTREF(__pyx_t_2);
6105 if (__Pyx_IternextUnpackEndCheck(__pyx_t_21(__pyx_t_3), 3) < 0) __PYX_ERR(0, 802, __pyx_L1_error)
6107 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6108 goto __pyx_L14_unpacking_done;
6109 __pyx_L13_unpacking_failed:;
6110 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6112 if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
6113 __PYX_ERR(0, 802, __pyx_L1_error)
6114 __pyx_L14_unpacking_done:;
6124 __Pyx_TraceLine(802,0,__PYX_ERR(0, 802, __pyx_L1_error))
6125 __pyx_v_trace = __pyx_t_4;
6127 __pyx_v_error = __pyx_t_5;
6129 __pyx_v_num_outliers = __pyx_t_2;
6139 __Pyx_TraceLine(806,0,__PYX_ERR(0, 806, __pyx_L1_error))
6140 __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_time);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 806, __pyx_L1_error)
6141 __Pyx_GOTREF(__pyx_t_2);
6142 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_perf_counter);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 806, __pyx_L1_error)
6143 __Pyx_GOTREF(__pyx_t_5);
6144 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6146 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
6147 __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_5);
6148 if (likely(__pyx_t_2)) {
6149 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_5);
6150 __Pyx_INCREF(__pyx_t_2);
6151 __Pyx_INCREF(
function);
6152 __Pyx_DECREF_SET(__pyx_t_5,
function);
6155 __pyx_t_20 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_5);
6156 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
6157 if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 806, __pyx_L1_error)
6158 __Pyx_GOTREF(__pyx_t_20);
6159 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
6160 __pyx_t_5 = PyNumber_Subtract(__pyx_t_20, __pyx_v_init_tot_wall_time);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 806, __pyx_L1_error)
6161 __Pyx_GOTREF(__pyx_t_5);
6162 __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
6163 __pyx_v_tot_wall_time = __pyx_t_5;
6173 __Pyx_TraceLine(807,0,__PYX_ERR(0, 807, __pyx_L1_error))
6174 __Pyx_GetModuleGlobalName(__pyx_t_20, __pyx_n_s_time);
if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 807, __pyx_L1_error)
6175 __Pyx_GOTREF(__pyx_t_20);
6176 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_20, __pyx_n_s_process_time);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 807, __pyx_L1_error)
6177 __Pyx_GOTREF(__pyx_t_2);
6178 __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
6180 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
6181 __pyx_t_20 = PyMethod_GET_SELF(__pyx_t_2);
6182 if (likely(__pyx_t_20)) {
6183 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_2);
6184 __Pyx_INCREF(__pyx_t_20);
6185 __Pyx_INCREF(
function);
6186 __Pyx_DECREF_SET(__pyx_t_2,
function);
6189 __pyx_t_5 = (__pyx_t_20) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_20) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
6190 __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0;
6191 if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 807, __pyx_L1_error)
6192 __Pyx_GOTREF(__pyx_t_5);
6193 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6194 __pyx_t_2 = PyNumber_Subtract(__pyx_t_5, __pyx_v_init_cpu_proc_time);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 807, __pyx_L1_error)
6195 __Pyx_GOTREF(__pyx_t_2);
6196 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
6197 __pyx_v_cpu_proc_time = __pyx_t_2;
6207 __Pyx_TraceLine(809,0,__PYX_ERR(0, 809, __pyx_L1_error))
6208 __Pyx_XDECREF(__pyx_r);
6217 __Pyx_TraceLine(810,0,__PYX_ERR(0, 810, __pyx_L1_error))
6218 __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_num_processed_samples);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 810, __pyx_L1_error)
6219 __Pyx_GOTREF(__pyx_t_2);
6220 __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_num_samples_used);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 810, __pyx_L1_error)
6221 __Pyx_GOTREF(__pyx_t_5);
6222 __pyx_t_20 = __Pyx_PyInt_From_int(__pyx_v_converged);
if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 810, __pyx_L1_error)
6223 __Pyx_GOTREF(__pyx_t_20);
6232 __Pyx_TraceLine(809,0,__PYX_ERR(0, 809, __pyx_L1_error))
6233 __pyx_t_4 = PyTuple_New(11);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 809, __pyx_L1_error)
6234 __Pyx_GOTREF(__pyx_t_4);
6235 __Pyx_INCREF(__pyx_v_trace);
6236 __Pyx_GIVEREF(__pyx_v_trace);
6237 PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_trace);
6238 __Pyx_INCREF(__pyx_v_error);
6239 __Pyx_GIVEREF(__pyx_v_error);
6240 PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_error);
6241 __Pyx_INCREF(__pyx_v_num_outliers);
6242 __Pyx_GIVEREF(__pyx_v_num_outliers);
6243 PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_num_outliers);
6244 __Pyx_INCREF(__pyx_v_samples);
6245 __Pyx_GIVEREF(__pyx_v_samples);
6246 PyTuple_SET_ITEM(__pyx_t_4, 3, __pyx_v_samples);
6247 __Pyx_INCREF(__pyx_v_processed_samples_indices);
6248 __Pyx_GIVEREF(__pyx_v_processed_samples_indices);
6249 PyTuple_SET_ITEM(__pyx_t_4, 4, __pyx_v_processed_samples_indices);
6250 __Pyx_GIVEREF(__pyx_t_2);
6251 PyTuple_SET_ITEM(__pyx_t_4, 5, __pyx_t_2);
6252 __Pyx_GIVEREF(__pyx_t_5);
6253 PyTuple_SET_ITEM(__pyx_t_4, 6, __pyx_t_5);
6254 __Pyx_GIVEREF(__pyx_t_20);
6255 PyTuple_SET_ITEM(__pyx_t_4, 7, __pyx_t_20);
6256 __Pyx_INCREF(__pyx_v_tot_wall_time);
6257 __Pyx_GIVEREF(__pyx_v_tot_wall_time);
6258 PyTuple_SET_ITEM(__pyx_t_4, 8, __pyx_v_tot_wall_time);
6259 __Pyx_INCREF(__pyx_v_alg_wall_time);
6260 __Pyx_GIVEREF(__pyx_v_alg_wall_time);
6261 PyTuple_SET_ITEM(__pyx_t_4, 9, __pyx_v_alg_wall_time);
6262 __Pyx_INCREF(__pyx_v_cpu_proc_time);
6263 __Pyx_GIVEREF(__pyx_v_cpu_proc_time);
6264 PyTuple_SET_ITEM(__pyx_t_4, 10, __pyx_v_cpu_proc_time);
6268 __pyx_r = __pyx_t_4;
6282 __Pyx_XDECREF(__pyx_t_1);
6283 __Pyx_XDECREF(__pyx_t_2);
6284 __Pyx_XDECREF(__pyx_t_3);
6285 __Pyx_XDECREF(__pyx_t_4);
6286 __Pyx_XDECREF(__pyx_t_5);
6287 __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
6288 __Pyx_XDECREF(__pyx_t_20);
6289 __Pyx_AddTraceback(
"imate.traceinv._hutchinson_method._hutchinson_method_float", __pyx_clineno, __pyx_lineno, __pyx_filename);
6292 __Pyx_XDECREF(__pyx_v_vector_size);
6293 __Pyx_XDECREF(__pyx_v_E);
6294 __PYX_XDEC_MEMVIEW(&__pyx_v_memoryview_E, 1);
6295 __Pyx_XDECREF(__pyx_v_init_tot_wall_time);
6296 __Pyx_XDECREF(__pyx_v_init_cpu_proc_time);
6297 __Pyx_XDECREF(__pyx_v_samples);
6298 __Pyx_XDECREF(__pyx_v_processed_samples_indices);
6299 __Pyx_XDECREF(__pyx_v_init_alg_wall_time);
6300 __Pyx_XDECREF(__pyx_v_AtA);
6301 __Pyx_XDECREF(__pyx_v_i);
6302 __Pyx_XDECREF(__pyx_v_alg_wall_time);
6303 __Pyx_XDECREF(__pyx_v_trace);
6304 __Pyx_XDECREF(__pyx_v_error);
6305 __Pyx_XDECREF(__pyx_v_num_outliers);
6306 __Pyx_XDECREF(__pyx_v_tot_wall_time);
6307 __Pyx_XDECREF(__pyx_v_cpu_proc_time);
6308 __Pyx_XGIVEREF(__pyx_r);
6309 __Pyx_TraceReturn(__pyx_r, 0);
6310 __Pyx_RefNannyFinishContext();
6323 static PyObject *__pyx_pw_5imate_8traceinv_18_hutchinson_method_5_hutchinson_method_double(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
6324 static char __pyx_doc_5imate_8traceinv_18_hutchinson_method_4_hutchinson_method_double[] =
"_hutchinson_method_double(A, B, C, gram, p, assume_matrix, min_num_samples, max_num_samples, error_atol, error_rtol, confidence_level, outlier_significance_level, solver_tol, orthogonalize, num_threads)\n\n This method processes double precision (64-bit) matrix ``A``.\n ";
6325 static PyMethodDef __pyx_mdef_5imate_8traceinv_18_hutchinson_method_5_hutchinson_method_double = {
"_hutchinson_method_double", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_5imate_8traceinv_18_hutchinson_method_5_hutchinson_method_double, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5imate_8traceinv_18_hutchinson_method_4_hutchinson_method_double};
6326 static PyObject *__pyx_pw_5imate_8traceinv_18_hutchinson_method_5_hutchinson_method_double(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
6327 PyObject *__pyx_v_A = 0;
6328 PyObject *__pyx_v_B = 0;
6329 PyObject *__pyx_v_C = 0;
6330 PyObject *__pyx_v_gram = 0;
6331 PyObject *__pyx_v_p = 0;
6332 PyObject *__pyx_v_assume_matrix = 0;
6333 PyObject *__pyx_v_min_num_samples = 0;
6334 PyObject *__pyx_v_max_num_samples = 0;
6335 PyObject *__pyx_v_error_atol = 0;
6336 PyObject *__pyx_v_error_rtol = 0;
6337 PyObject *__pyx_v_confidence_level = 0;
6338 PyObject *__pyx_v_outlier_significance_level = 0;
6339 PyObject *__pyx_v_solver_tol = 0;
6340 PyObject *__pyx_v_orthogonalize = 0;
6341 PyObject *__pyx_v_num_threads = 0;
6342 int __pyx_lineno = 0;
6343 const char *__pyx_filename = NULL;
6344 int __pyx_clineno = 0;
6345 PyObject *__pyx_r = 0;
6346 __Pyx_RefNannyDeclarations
6347 __Pyx_RefNannySetupContext(
"_hutchinson_method_double (wrapper)", 0);
6349 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_A,&__pyx_n_s_B,&__pyx_n_s_C,&__pyx_n_s_gram,&__pyx_n_s_p,&__pyx_n_s_assume_matrix,&__pyx_n_s_min_num_samples,&__pyx_n_s_max_num_samples,&__pyx_n_s_error_atol,&__pyx_n_s_error_rtol,&__pyx_n_s_confidence_level,&__pyx_n_s_outlier_significance_level,&__pyx_n_s_solver_tol,&__pyx_n_s_orthogonalize,&__pyx_n_s_num_threads,0};
6350 PyObject* values[15] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
6351 if (unlikely(__pyx_kwds)) {
6353 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
6355 case 15: values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
6357 case 14: values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
6359 case 13: values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
6361 case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
6363 case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
6365 case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
6367 case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
6369 case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
6371 case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
6373 case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
6375 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
6377 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
6379 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
6381 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6383 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6386 default:
goto __pyx_L5_argtuple_error;
6388 kw_args = PyDict_Size(__pyx_kwds);
6391 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_A)) != 0)) kw_args--;
6392 else goto __pyx_L5_argtuple_error;
6395 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_B)) != 0)) kw_args--;
6397 __Pyx_RaiseArgtupleInvalid(
"_hutchinson_method_double", 1, 15, 15, 1); __PYX_ERR(0, 818, __pyx_L3_error)
6401 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_C)) != 0)) kw_args--;
6403 __Pyx_RaiseArgtupleInvalid(
"_hutchinson_method_double", 1, 15, 15, 2); __PYX_ERR(0, 818, __pyx_L3_error)
6407 if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_gram)) != 0)) kw_args--;
6409 __Pyx_RaiseArgtupleInvalid(
"_hutchinson_method_double", 1, 15, 15, 3); __PYX_ERR(0, 818, __pyx_L3_error)
6413 if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_p)) != 0)) kw_args--;
6415 __Pyx_RaiseArgtupleInvalid(
"_hutchinson_method_double", 1, 15, 15, 4); __PYX_ERR(0, 818, __pyx_L3_error)
6419 if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_assume_matrix)) != 0)) kw_args--;
6421 __Pyx_RaiseArgtupleInvalid(
"_hutchinson_method_double", 1, 15, 15, 5); __PYX_ERR(0, 818, __pyx_L3_error)
6425 if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_min_num_samples)) != 0)) kw_args--;
6427 __Pyx_RaiseArgtupleInvalid(
"_hutchinson_method_double", 1, 15, 15, 6); __PYX_ERR(0, 818, __pyx_L3_error)
6431 if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_max_num_samples)) != 0)) kw_args--;
6433 __Pyx_RaiseArgtupleInvalid(
"_hutchinson_method_double", 1, 15, 15, 7); __PYX_ERR(0, 818, __pyx_L3_error)
6437 if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_error_atol)) != 0)) kw_args--;
6439 __Pyx_RaiseArgtupleInvalid(
"_hutchinson_method_double", 1, 15, 15, 8); __PYX_ERR(0, 818, __pyx_L3_error)
6443 if (likely((values[9] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_error_rtol)) != 0)) kw_args--;
6445 __Pyx_RaiseArgtupleInvalid(
"_hutchinson_method_double", 1, 15, 15, 9); __PYX_ERR(0, 818, __pyx_L3_error)
6449 if (likely((values[10] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_confidence_level)) != 0)) kw_args--;
6451 __Pyx_RaiseArgtupleInvalid(
"_hutchinson_method_double", 1, 15, 15, 10); __PYX_ERR(0, 818, __pyx_L3_error)
6455 if (likely((values[11] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_outlier_significance_level)) != 0)) kw_args--;
6457 __Pyx_RaiseArgtupleInvalid(
"_hutchinson_method_double", 1, 15, 15, 11); __PYX_ERR(0, 818, __pyx_L3_error)
6461 if (likely((values[12] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_solver_tol)) != 0)) kw_args--;
6463 __Pyx_RaiseArgtupleInvalid(
"_hutchinson_method_double", 1, 15, 15, 12); __PYX_ERR(0, 818, __pyx_L3_error)
6467 if (likely((values[13] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_orthogonalize)) != 0)) kw_args--;
6469 __Pyx_RaiseArgtupleInvalid(
"_hutchinson_method_double", 1, 15, 15, 13); __PYX_ERR(0, 818, __pyx_L3_error)
6473 if (likely((values[14] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_num_threads)) != 0)) kw_args--;
6475 __Pyx_RaiseArgtupleInvalid(
"_hutchinson_method_double", 1, 15, 15, 14); __PYX_ERR(0, 818, __pyx_L3_error)
6478 if (unlikely(kw_args > 0)) {
6479 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"_hutchinson_method_double") < 0)) __PYX_ERR(0, 818, __pyx_L3_error)
6481 }
else if (PyTuple_GET_SIZE(__pyx_args) != 15) {
6482 goto __pyx_L5_argtuple_error;
6484 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6485 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6486 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
6487 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
6488 values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
6489 values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
6490 values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
6491 values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
6492 values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
6493 values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
6494 values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
6495 values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
6496 values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
6497 values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
6498 values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
6500 __pyx_v_A = values[0];
6501 __pyx_v_B = values[1];
6502 __pyx_v_C = values[2];
6503 __pyx_v_gram = values[3];
6504 __pyx_v_p = values[4];
6505 __pyx_v_assume_matrix = values[5];
6506 __pyx_v_min_num_samples = values[6];
6507 __pyx_v_max_num_samples = values[7];
6508 __pyx_v_error_atol = values[8];
6509 __pyx_v_error_rtol = values[9];
6510 __pyx_v_confidence_level = values[10];
6511 __pyx_v_outlier_significance_level = values[11];
6512 __pyx_v_solver_tol = values[12];
6513 __pyx_v_orthogonalize = values[13];
6514 __pyx_v_num_threads = values[14];
6516 goto __pyx_L4_argument_unpacking_done;
6517 __pyx_L5_argtuple_error:;
6518 __Pyx_RaiseArgtupleInvalid(
"_hutchinson_method_double", 1, 15, 15, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 818, __pyx_L3_error)
6520 __Pyx_AddTraceback(
"imate.traceinv._hutchinson_method._hutchinson_method_double", __pyx_clineno, __pyx_lineno, __pyx_filename);
6521 __Pyx_RefNannyFinishContext();
6523 __pyx_L4_argument_unpacking_done:;
6524 __pyx_r = __pyx_pf_5imate_8traceinv_18_hutchinson_method_4_hutchinson_method_double(__pyx_self, __pyx_v_A, __pyx_v_B, __pyx_v_C, __pyx_v_gram, __pyx_v_p, __pyx_v_assume_matrix, __pyx_v_min_num_samples, __pyx_v_max_num_samples, __pyx_v_error_atol, __pyx_v_error_rtol, __pyx_v_confidence_level, __pyx_v_outlier_significance_level, __pyx_v_solver_tol, __pyx_v_orthogonalize, __pyx_v_num_threads);
6527 __Pyx_RefNannyFinishContext();
6531 static PyObject *__pyx_pf_5imate_8traceinv_18_hutchinson_method_4_hutchinson_method_double(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_B, PyObject *__pyx_v_C, PyObject *__pyx_v_gram, PyObject *__pyx_v_p, PyObject *__pyx_v_assume_matrix, PyObject *__pyx_v_min_num_samples, PyObject *__pyx_v_max_num_samples, PyObject *__pyx_v_error_atol, PyObject *__pyx_v_error_rtol, PyObject *__pyx_v_confidence_level, PyObject *__pyx_v_outlier_significance_level, PyObject *__pyx_v_solver_tol, PyObject *__pyx_v_orthogonalize, PyObject *__pyx_v_num_threads) {
6532 PyObject *__pyx_v_vector_size = NULL;
6533 PyObject *__pyx_v_E = NULL;
6534 __Pyx_memviewslice __pyx_v_memoryview_E = { 0, 0, { 0 }, { 0 }, { 0 } };
6536 PyObject *__pyx_v_init_tot_wall_time = NULL;
6537 PyObject *__pyx_v_init_cpu_proc_time = NULL;
6538 PyObject *__pyx_v_samples = NULL;
6539 PyObject *__pyx_v_processed_samples_indices = NULL;
6540 int __pyx_v_num_processed_samples;
6541 int __pyx_v_num_samples_used;
6542 int __pyx_v_converged;
6543 PyObject *__pyx_v_init_alg_wall_time = NULL;
6544 PyObject *__pyx_v_AtA = NULL;
6545 PyObject *__pyx_v_i = NULL;
6546 PyObject *__pyx_v_alg_wall_time = NULL;
6547 PyObject *__pyx_v_trace = NULL;
6548 PyObject *__pyx_v_error = NULL;
6549 PyObject *__pyx_v_num_outliers = NULL;
6550 PyObject *__pyx_v_tot_wall_time = NULL;
6551 PyObject *__pyx_v_cpu_proc_time = NULL;
6552 PyObject *__pyx_r = NULL;
6553 __Pyx_TraceDeclarations
6554 __Pyx_RefNannyDeclarations
6555 PyObject *__pyx_t_1 = NULL;
6556 PyObject *__pyx_t_2 = NULL;
6557 PyObject *__pyx_t_3 = NULL;
6558 PyObject *__pyx_t_4 = NULL;
6559 PyObject *__pyx_t_5 = NULL;
6560 __Pyx_memviewslice __pyx_t_6 = { 0, 0, { 0 }, { 0 }, { 0 } };
6561 Py_ssize_t __pyx_t_7;
6562 Py_ssize_t __pyx_t_8;
6563 __pyx_t_5imate_12_definitions_5types_LongIndexType __pyx_t_9;
6564 __pyx_t_5imate_12_definitions_5types_IndexType __pyx_t_10;
6565 __pyx_t_5imate_12_definitions_5types_IndexType __pyx_t_11;
6566 __pyx_t_5imate_12_definitions_5types_IndexType __pyx_t_12;
6570 Py_ssize_t __pyx_t_16;
6571 PyObject *(*__pyx_t_17)(PyObject *);
6574 PyObject *__pyx_t_20 = NULL;
6575 PyObject *(*__pyx_t_21)(PyObject *);
6577 int __pyx_lineno = 0;
6578 const char *__pyx_filename = NULL;
6579 int __pyx_clineno = 0;
6580 __Pyx_TraceFrameInit(__pyx_codeobj__5)
6581 __Pyx_RefNannySetupContext(
"_hutchinson_method_double", 0);
6582 __Pyx_TraceCall(
"_hutchinson_method_double", __pyx_f[0], 818, 0, __PYX_ERR(0, 818, __pyx_L1_error));
6591 __Pyx_TraceLine(838,0,__PYX_ERR(0, 838, __pyx_L1_error))
6592 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_shape);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 838, __pyx_L1_error)
6593 __Pyx_GOTREF(__pyx_t_1);
6594 __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0,
long, 1, __Pyx_PyInt_From_long, 0, 0, 0);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 838, __pyx_L1_error)
6595 __Pyx_GOTREF(__pyx_t_2);
6596 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6597 __pyx_v_vector_size = __pyx_t_2;
6607 __Pyx_TraceLine(842,0,__PYX_ERR(0, 842, __pyx_L1_error))
6608 __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_numpy);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 842, __pyx_L1_error)
6609 __Pyx_GOTREF(__pyx_t_2);
6610 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 842, __pyx_L1_error)
6611 __Pyx_GOTREF(__pyx_t_1);
6612 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6613 __pyx_t_2 = PyTuple_New(2);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 842, __pyx_L1_error)
6614 __Pyx_GOTREF(__pyx_t_2);
6615 __Pyx_INCREF(__pyx_v_vector_size);
6616 __Pyx_GIVEREF(__pyx_v_vector_size);
6617 PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_vector_size);
6618 __Pyx_INCREF(__pyx_v_max_num_samples);
6619 __Pyx_GIVEREF(__pyx_v_max_num_samples);
6620 PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_max_num_samples);
6621 __pyx_t_3 = PyTuple_New(1);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 842, __pyx_L1_error)
6622 __Pyx_GOTREF(__pyx_t_3);
6623 __Pyx_GIVEREF(__pyx_t_2);
6624 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
6626 __pyx_t_2 = __Pyx_PyDict_NewPresized(2);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 842, __pyx_L1_error)
6627 __Pyx_GOTREF(__pyx_t_2);
6628 __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_numpy);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 842, __pyx_L1_error)
6629 __Pyx_GOTREF(__pyx_t_4);
6630 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_float64);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 842, __pyx_L1_error)
6631 __Pyx_GOTREF(__pyx_t_5);
6632 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6633 if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_5) < 0) __PYX_ERR(0, 842, __pyx_L1_error)
6634 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
6635 if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_order, __pyx_n_u_F) < 0) __PYX_ERR(0, 842, __pyx_L1_error)
6636 __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_2);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 842, __pyx_L1_error)
6637 __Pyx_GOTREF(__pyx_t_5);
6638 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6639 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6640 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6641 __pyx_v_E = __pyx_t_5;
6651 __Pyx_TraceLine(846,0,__PYX_ERR(0, 846, __pyx_L1_error))
6652 __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_dcd__double(__pyx_v_E, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 846, __pyx_L1_error)
6653 __pyx_v_memoryview_E = __pyx_t_6;
6654 __pyx_t_6.memview = NULL;
6655 __pyx_t_6.data = NULL;
6664 __Pyx_TraceLine(847,0,__PYX_ERR(0, 847, __pyx_L1_error))
6667 __pyx_v_cE = (&(*((
double *) ( (( ((
char *) (((
double *) __pyx_v_memoryview_E.data) + __pyx_t_7)) ) + __pyx_t_8 * __pyx_v_memoryview_E.strides[1]) ))));
6676 __Pyx_TraceLine(849,0,__PYX_ERR(0, 849, __pyx_L1_error))
6677 __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_time);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 849, __pyx_L1_error)
6678 __Pyx_GOTREF(__pyx_t_2);
6679 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_perf_counter);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 849, __pyx_L1_error)
6680 __Pyx_GOTREF(__pyx_t_3);
6681 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6683 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
6684 __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
6685 if (likely(__pyx_t_2)) {
6686 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
6687 __Pyx_INCREF(__pyx_t_2);
6688 __Pyx_INCREF(
function);
6689 __Pyx_DECREF_SET(__pyx_t_3,
function);
6692 __pyx_t_5 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
6693 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
6694 if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 849, __pyx_L1_error)
6695 __Pyx_GOTREF(__pyx_t_5);
6696 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6697 __pyx_v_init_tot_wall_time = __pyx_t_5;
6707 __Pyx_TraceLine(850,0,__PYX_ERR(0, 850, __pyx_L1_error))
6708 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_time);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 850, __pyx_L1_error)
6709 __Pyx_GOTREF(__pyx_t_3);
6710 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_process_time);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 850, __pyx_L1_error)
6711 __Pyx_GOTREF(__pyx_t_2);
6712 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6714 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
6715 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
6716 if (likely(__pyx_t_3)) {
6717 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_2);
6718 __Pyx_INCREF(__pyx_t_3);
6719 __Pyx_INCREF(
function);
6720 __Pyx_DECREF_SET(__pyx_t_2,
function);
6723 __pyx_t_5 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
6724 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
6725 if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 850, __pyx_L1_error)
6726 __Pyx_GOTREF(__pyx_t_5);
6727 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6728 __pyx_v_init_cpu_proc_time = __pyx_t_5;
6738 __Pyx_TraceLine(853,0,__PYX_ERR(0, 853, __pyx_L1_error))
6739 __pyx_t_9 = __Pyx_PyInt_As_int(__pyx_v_vector_size);
if (unlikely((__pyx_t_9 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 853, __pyx_L1_error)
6740 __pyx_t_10 = __Pyx_PyInt_As_int(__pyx_v_max_num_samples);
if (unlikely((__pyx_t_10 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 853, __pyx_L1_error)
6749 __Pyx_TraceLine(854,0,__PYX_ERR(0, 854, __pyx_L1_error))
6750 __pyx_t_5 = __Pyx_PyNumber_Int(__pyx_v_orthogonalize);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 854, __pyx_L1_error)
6751 __Pyx_GOTREF(__pyx_t_5);
6752 __pyx_t_11 = __Pyx_PyInt_As_int(__pyx_t_5);
if (unlikely((__pyx_t_11 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 854, __pyx_L1_error)
6753 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
6754 __pyx_t_12 = __Pyx_PyInt_As_int(__pyx_v_num_threads);
if (unlikely((__pyx_t_12 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 854, __pyx_L1_error)
6763 __Pyx_TraceLine(853,0,__PYX_ERR(0, 853, __pyx_L1_error))
6764 __pyx_fuse_1__pyx_f_5imate_15_linear_algebra_14random_vectors_generate_random_column_vectors(__pyx_v_cE, __pyx_t_9, __pyx_t_10, __pyx_t_11, __pyx_t_12);
6773 __Pyx_TraceLine(856,0,__PYX_ERR(0, 856, __pyx_L1_error))
6774 __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_numpy);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 856, __pyx_L1_error)
6775 __Pyx_GOTREF(__pyx_t_5);
6776 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_zeros);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 856, __pyx_L1_error)
6777 __Pyx_GOTREF(__pyx_t_2);
6778 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
6779 __pyx_t_5 = PyTuple_New(1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 856, __pyx_L1_error)
6780 __Pyx_GOTREF(__pyx_t_5);
6781 __Pyx_INCREF(__pyx_v_max_num_samples);
6782 __Pyx_GIVEREF(__pyx_v_max_num_samples);
6783 PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_max_num_samples);
6784 __pyx_t_3 = PyTuple_New(1);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 856, __pyx_L1_error)
6785 __Pyx_GOTREF(__pyx_t_3);
6786 __Pyx_GIVEREF(__pyx_t_5);
6787 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5);
6789 __pyx_t_5 = __Pyx_PyDict_NewPresized(1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 856, __pyx_L1_error)
6790 __Pyx_GOTREF(__pyx_t_5);
6791 __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_numpy);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 856, __pyx_L1_error)
6792 __Pyx_GOTREF(__pyx_t_1);
6793 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_float64);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 856, __pyx_L1_error)
6794 __Pyx_GOTREF(__pyx_t_4);
6795 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6796 if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_t_4) < 0) __PYX_ERR(0, 856, __pyx_L1_error)
6797 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6798 __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_5);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 856, __pyx_L1_error)
6799 __Pyx_GOTREF(__pyx_t_4);
6800 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6801 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6802 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
6803 __pyx_v_samples = __pyx_t_4;
6813 __Pyx_TraceLine(857,0,__PYX_ERR(0, 857, __pyx_L1_error))
6814 __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_numpy);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 857, __pyx_L1_error)
6815 __Pyx_GOTREF(__pyx_t_4);
6816 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_zeros);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 857, __pyx_L1_error)
6817 __Pyx_GOTREF(__pyx_t_5);
6818 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6819 __pyx_t_4 = PyTuple_New(1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 857, __pyx_L1_error)
6820 __Pyx_GOTREF(__pyx_t_4);
6821 __Pyx_INCREF(__pyx_v_max_num_samples);
6822 __Pyx_GIVEREF(__pyx_v_max_num_samples);
6823 PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_max_num_samples);
6824 __pyx_t_3 = PyTuple_New(1);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 857, __pyx_L1_error)
6825 __Pyx_GOTREF(__pyx_t_3);
6826 __Pyx_GIVEREF(__pyx_t_4);
6827 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
6829 __pyx_t_4 = __Pyx_PyDict_NewPresized(1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 857, __pyx_L1_error)
6830 __Pyx_GOTREF(__pyx_t_4);
6831 if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, ((PyObject *)(&PyInt_Type))) < 0) __PYX_ERR(0, 857, __pyx_L1_error)
6832 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_3, __pyx_t_4);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 857, __pyx_L1_error)
6833 __Pyx_GOTREF(__pyx_t_2);
6834 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
6835 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6836 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6837 __pyx_v_processed_samples_indices = __pyx_t_2;
6847 __Pyx_TraceLine(858,0,__PYX_ERR(0, 858, __pyx_L1_error))
6848 __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_numpy);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 858, __pyx_L1_error)
6849 __Pyx_GOTREF(__pyx_t_2);
6850 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_nan);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 858, __pyx_L1_error)
6851 __Pyx_GOTREF(__pyx_t_4);
6852 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6853 if (__Pyx_PyObject_SetSlice(__pyx_v_samples, __pyx_t_4, 0, 0, NULL, NULL, &__pyx_slice__4, 0, 0, 0) < 0) __PYX_ERR(0, 858, __pyx_L1_error)
6854 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6863 __Pyx_TraceLine(859,0,__PYX_ERR(0, 859, __pyx_L1_error))
6864 __pyx_v_num_processed_samples = 0;
6873 __Pyx_TraceLine(860,0,__PYX_ERR(0, 860, __pyx_L1_error))
6874 __pyx_v_num_samples_used = 0;
6883 __Pyx_TraceLine(861,0,__PYX_ERR(0, 861, __pyx_L1_error))
6884 __pyx_v_converged = 0;
6893 __Pyx_TraceLine(863,0,__PYX_ERR(0, 863, __pyx_L1_error))
6894 __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_time);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 863, __pyx_L1_error)
6895 __Pyx_GOTREF(__pyx_t_2);
6896 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_perf_counter);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 863, __pyx_L1_error)
6897 __Pyx_GOTREF(__pyx_t_3);
6898 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6900 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
6901 __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
6902 if (likely(__pyx_t_2)) {
6903 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
6904 __Pyx_INCREF(__pyx_t_2);
6905 __Pyx_INCREF(
function);
6906 __Pyx_DECREF_SET(__pyx_t_3,
function);
6909 __pyx_t_4 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
6910 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
6911 if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 863, __pyx_L1_error)
6912 __Pyx_GOTREF(__pyx_t_4);
6913 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6914 __pyx_v_init_alg_wall_time = __pyx_t_4;
6924 __Pyx_TraceLine(866,0,__PYX_ERR(0, 866, __pyx_L1_error))
6925 __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_v_gram);
if (unlikely(__pyx_t_13 < 0)) __PYX_ERR(0, 866, __pyx_L1_error)
6935 __Pyx_TraceLine(867,0,__PYX_ERR(0, 867, __pyx_L1_error))
6936 __pyx_t_4 = __Pyx_PyInt_EqObjC(__pyx_v_p, __pyx_int_1, 1, 0);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 867, __pyx_L1_error)
6937 __Pyx_GOTREF(__pyx_t_4);
6938 __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_4);
if (unlikely(__pyx_t_14 < 0)) __PYX_ERR(0, 867, __pyx_L1_error)
6939 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6942 __pyx_t_13 = __pyx_t_14;
6943 goto __pyx_L5_bool_binop_done;
6945 __pyx_t_14 = (__pyx_v_B == Py_None);
6946 __pyx_t_15 = (__pyx_t_14 != 0);
6949 __pyx_t_13 = __pyx_t_15;
6950 goto __pyx_L5_bool_binop_done;
6952 __pyx_t_15 = (__pyx_v_C == Py_None);
6953 __pyx_t_14 = (__pyx_t_15 != 0);
6954 __pyx_t_13 = __pyx_t_14;
6955 __pyx_L5_bool_binop_done:;
6965 __Pyx_TraceLine(869,0,__PYX_ERR(0, 869, __pyx_L1_error))
6966 __Pyx_INCREF(Py_None);
6967 __pyx_v_AtA = Py_None;
6986 __Pyx_TraceLine(871,0,__PYX_ERR(0, 871, __pyx_L1_error))
6988 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_T);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 871, __pyx_L1_error)
6989 __Pyx_GOTREF(__pyx_t_4);
6990 __pyx_t_3 = __Pyx_PyNumber_MatrixMultiply(__pyx_t_4, __pyx_v_A);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 871, __pyx_L1_error)
6991 __Pyx_GOTREF(__pyx_t_3);
6992 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6993 __pyx_v_AtA = __pyx_t_3;
7015 __Pyx_TraceLine(873,0,__PYX_ERR(0, 873, __pyx_L1_error))
7017 __Pyx_INCREF(Py_None);
7018 __pyx_v_AtA = Py_None;
7029 __Pyx_TraceLine(876,0,__PYX_ERR(0, 876, __pyx_L1_error))
7030 __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_v_max_num_samples);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 876, __pyx_L1_error)
7031 __Pyx_GOTREF(__pyx_t_3);
7032 if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) {
7033 __pyx_t_4 = __pyx_t_3; __Pyx_INCREF(__pyx_t_4); __pyx_t_16 = 0;
7036 __pyx_t_16 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_3);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 876, __pyx_L1_error)
7037 __Pyx_GOTREF(__pyx_t_4);
7038 __pyx_t_17 = Py_TYPE(__pyx_t_4)->tp_iternext;
if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 876, __pyx_L1_error)
7040 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7042 if (likely(!__pyx_t_17)) {
7043 if (likely(PyList_CheckExact(__pyx_t_4))) {
7044 if (__pyx_t_16 >= PyList_GET_SIZE(__pyx_t_4))
break;
7045 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
7046 __pyx_t_3 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_16); __Pyx_INCREF(__pyx_t_3); __pyx_t_16++;
if (unlikely(0 < 0)) __PYX_ERR(0, 876, __pyx_L1_error)
7048 __pyx_t_3 = PySequence_ITEM(__pyx_t_4, __pyx_t_16); __pyx_t_16++;
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 876, __pyx_L1_error)
7049 __Pyx_GOTREF(__pyx_t_3);
7052 if (__pyx_t_16 >= PyTuple_GET_SIZE(__pyx_t_4))
break;
7053 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
7054 __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_16); __Pyx_INCREF(__pyx_t_3); __pyx_t_16++;
if (unlikely(0 < 0)) __PYX_ERR(0, 876, __pyx_L1_error)
7056 __pyx_t_3 = PySequence_ITEM(__pyx_t_4, __pyx_t_16); __pyx_t_16++;
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 876, __pyx_L1_error)
7057 __Pyx_GOTREF(__pyx_t_3);
7061 __pyx_t_3 = __pyx_t_17(__pyx_t_4);
7062 if (unlikely(!__pyx_t_3)) {
7063 PyObject* exc_type = PyErr_Occurred();
7065 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
7066 else __PYX_ERR(0, 876, __pyx_L1_error)
7070 __Pyx_GOTREF(__pyx_t_3);
7072 __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_3);
7082 __Pyx_TraceLine(878,0,__PYX_ERR(0, 878, __pyx_L1_error))
7083 __pyx_t_13 = ((__pyx_v_converged == 0) != 0);
7093 __Pyx_TraceLine(882,0,__PYX_ERR(0, 882, __pyx_L1_error))
7094 __pyx_t_3 = PyTuple_New(2);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 882, __pyx_L1_error)
7095 __Pyx_GOTREF(__pyx_t_3);
7096 __Pyx_INCREF(__pyx_slice__4);
7097 __Pyx_GIVEREF(__pyx_slice__4);
7098 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_slice__4);
7099 __Pyx_INCREF(__pyx_v_i);
7100 __Pyx_GIVEREF(__pyx_v_i);
7101 PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_i);
7102 __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_v_E, __pyx_t_3);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 882, __pyx_L1_error)
7103 __Pyx_GOTREF(__pyx_t_2);
7104 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7113 __Pyx_TraceLine(881,0,__PYX_ERR(0, 881, __pyx_L1_error))
7114 __pyx_t_18 = __pyx_f_5imate_8traceinv_18_hutchinson_method__stochastic_trace_estimator_double(__pyx_v_A, __pyx_v_AtA, __pyx_v_B, __pyx_v_C, __pyx_t_2, __pyx_v_gram, __pyx_v_p, __pyx_v_assume_matrix, __pyx_v_solver_tol);
if (unlikely(__pyx_t_18 == ((
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 881, __pyx_L1_error)
7115 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7116 __pyx_t_2 = PyFloat_FromDouble(__pyx_t_18);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 881, __pyx_L1_error)
7117 __Pyx_GOTREF(__pyx_t_2);
7118 if (unlikely(PyObject_SetItem(__pyx_v_samples, __pyx_v_i, __pyx_t_2) < 0)) __PYX_ERR(0, 881, __pyx_L1_error)
7119 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7128 __Pyx_TraceLine(885,0,__PYX_ERR(0, 885, __pyx_L1_error))
7129 if (unlikely(__Pyx_SetItemInt(__pyx_v_processed_samples_indices, __pyx_v_num_processed_samples, __pyx_v_i,
int, 1, __Pyx_PyInt_From_int, 0, 0, 0) < 0)) __PYX_ERR(0, 885, __pyx_L1_error)
7138 __Pyx_TraceLine(886,0,__PYX_ERR(0, 886, __pyx_L1_error))
7139 __pyx_v_num_processed_samples = (__pyx_v_num_processed_samples + 1);
7148 __Pyx_TraceLine(891,0,__PYX_ERR(0, 891, __pyx_L1_error))
7149 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_check_convergence);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 891, __pyx_L1_error)
7150 __Pyx_GOTREF(__pyx_t_3);
7159 __Pyx_TraceLine(893,0,__PYX_ERR(0, 893, __pyx_L1_error))
7160 __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_num_processed_samples);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 893, __pyx_L1_error)
7161 __Pyx_GOTREF(__pyx_t_5);
7170 __Pyx_TraceLine(894,0,__PYX_ERR(0, 894, __pyx_L1_error))
7173 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
7174 __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
7175 if (likely(__pyx_t_1)) {
7176 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
7177 __Pyx_INCREF(__pyx_t_1);
7178 __Pyx_INCREF(
function);
7179 __Pyx_DECREF_SET(__pyx_t_3,
function);
7183 #if CYTHON_FAST_PYCALL
7184 if (PyFunction_Check(__pyx_t_3)) {
7185 PyObject *__pyx_temp[8] = {__pyx_t_1, __pyx_v_samples, __pyx_v_min_num_samples, __pyx_v_processed_samples_indices, __pyx_t_5, __pyx_v_confidence_level, __pyx_v_error_atol, __pyx_v_error_rtol};
7186 __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_19, 7+__pyx_t_19);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 891, __pyx_L1_error)
7187 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
7188 __Pyx_GOTREF(__pyx_t_2);
7189 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
7192 #if CYTHON_FAST_PYCCALL
7193 if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
7194 PyObject *__pyx_temp[8] = {__pyx_t_1, __pyx_v_samples, __pyx_v_min_num_samples, __pyx_v_processed_samples_indices, __pyx_t_5, __pyx_v_confidence_level, __pyx_v_error_atol, __pyx_v_error_rtol};
7195 __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_19, 7+__pyx_t_19);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 891, __pyx_L1_error)
7196 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
7197 __Pyx_GOTREF(__pyx_t_2);
7198 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
7202 __pyx_t_20 = PyTuple_New(7+__pyx_t_19);
if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 891, __pyx_L1_error)
7203 __Pyx_GOTREF(__pyx_t_20);
7205 __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_20, 0, __pyx_t_1); __pyx_t_1 = NULL;
7207 __Pyx_INCREF(__pyx_v_samples);
7208 __Pyx_GIVEREF(__pyx_v_samples);
7209 PyTuple_SET_ITEM(__pyx_t_20, 0+__pyx_t_19, __pyx_v_samples);
7210 __Pyx_INCREF(__pyx_v_min_num_samples);
7211 __Pyx_GIVEREF(__pyx_v_min_num_samples);
7212 PyTuple_SET_ITEM(__pyx_t_20, 1+__pyx_t_19, __pyx_v_min_num_samples);
7213 __Pyx_INCREF(__pyx_v_processed_samples_indices);
7214 __Pyx_GIVEREF(__pyx_v_processed_samples_indices);
7215 PyTuple_SET_ITEM(__pyx_t_20, 2+__pyx_t_19, __pyx_v_processed_samples_indices);
7216 __Pyx_GIVEREF(__pyx_t_5);
7217 PyTuple_SET_ITEM(__pyx_t_20, 3+__pyx_t_19, __pyx_t_5);
7218 __Pyx_INCREF(__pyx_v_confidence_level);
7219 __Pyx_GIVEREF(__pyx_v_confidence_level);
7220 PyTuple_SET_ITEM(__pyx_t_20, 4+__pyx_t_19, __pyx_v_confidence_level);
7221 __Pyx_INCREF(__pyx_v_error_atol);
7222 __Pyx_GIVEREF(__pyx_v_error_atol);
7223 PyTuple_SET_ITEM(__pyx_t_20, 5+__pyx_t_19, __pyx_v_error_atol);
7224 __Pyx_INCREF(__pyx_v_error_rtol);
7225 __Pyx_GIVEREF(__pyx_v_error_rtol);
7226 PyTuple_SET_ITEM(__pyx_t_20, 6+__pyx_t_19, __pyx_v_error_rtol);
7228 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_20, NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 891, __pyx_L1_error)
7229 __Pyx_GOTREF(__pyx_t_2);
7230 __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
7232 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7233 if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) {
7234 PyObject* sequence = __pyx_t_2;
7235 Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
7236 if (unlikely(size != 2)) {
7237 if (size > 2) __Pyx_RaiseTooManyValuesError(2);
7238 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
7239 __PYX_ERR(0, 891, __pyx_L1_error)
7241 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
7242 if (likely(PyTuple_CheckExact(sequence))) {
7243 __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0);
7244 __pyx_t_20 = PyTuple_GET_ITEM(sequence, 1);
7246 __pyx_t_3 = PyList_GET_ITEM(sequence, 0);
7247 __pyx_t_20 = PyList_GET_ITEM(sequence, 1);
7249 __Pyx_INCREF(__pyx_t_3);
7250 __Pyx_INCREF(__pyx_t_20);
7252 __pyx_t_3 = PySequence_ITEM(sequence, 0);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 891, __pyx_L1_error)
7253 __Pyx_GOTREF(__pyx_t_3);
7254 __pyx_t_20 = PySequence_ITEM(sequence, 1);
if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 891, __pyx_L1_error)
7255 __Pyx_GOTREF(__pyx_t_20);
7257 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7259 Py_ssize_t index = -1;
7260 __pyx_t_5 = PyObject_GetIter(__pyx_t_2);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 891, __pyx_L1_error)
7261 __Pyx_GOTREF(__pyx_t_5);
7262 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7263 __pyx_t_21 = Py_TYPE(__pyx_t_5)->tp_iternext;
7264 index = 0; __pyx_t_3 = __pyx_t_21(__pyx_t_5);
if (unlikely(!__pyx_t_3))
goto __pyx_L11_unpacking_failed;
7265 __Pyx_GOTREF(__pyx_t_3);
7266 index = 1; __pyx_t_20 = __pyx_t_21(__pyx_t_5);
if (unlikely(!__pyx_t_20))
goto __pyx_L11_unpacking_failed;
7267 __Pyx_GOTREF(__pyx_t_20);
7268 if (__Pyx_IternextUnpackEndCheck(__pyx_t_21(__pyx_t_5), 2) < 0) __PYX_ERR(0, 891, __pyx_L1_error)
7270 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
7271 goto __pyx_L12_unpacking_done;
7272 __pyx_L11_unpacking_failed:;
7273 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
7275 if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
7276 __PYX_ERR(0, 891, __pyx_L1_error)
7277 __pyx_L12_unpacking_done:;
7287 __Pyx_TraceLine(891,0,__PYX_ERR(0, 891, __pyx_L1_error))
7288 __pyx_t_19 = __Pyx_PyInt_As_int(__pyx_t_3);
if (unlikely((__pyx_t_19 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 891, __pyx_L1_error)
7289 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7290 __pyx_t_22 = __Pyx_PyInt_As_int(__pyx_t_20);
if (unlikely((__pyx_t_22 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 891, __pyx_L1_error)
7291 __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
7292 __pyx_v_converged = __pyx_t_19;
7293 __pyx_v_num_samples_used = __pyx_t_22;
7311 __Pyx_TraceLine(876,0,__PYX_ERR(0, 876, __pyx_L1_error))
7313 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7322 __Pyx_TraceLine(896,0,__PYX_ERR(0, 896, __pyx_L1_error))
7323 __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_time);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 896, __pyx_L1_error)
7324 __Pyx_GOTREF(__pyx_t_2);
7325 __pyx_t_20 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_perf_counter);
if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 896, __pyx_L1_error)
7326 __Pyx_GOTREF(__pyx_t_20);
7327 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7329 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_20))) {
7330 __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_20);
7331 if (likely(__pyx_t_2)) {
7332 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_20);
7333 __Pyx_INCREF(__pyx_t_2);
7334 __Pyx_INCREF(
function);
7335 __Pyx_DECREF_SET(__pyx_t_20,
function);
7338 __pyx_t_4 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_20, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_20);
7339 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
7340 if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 896, __pyx_L1_error)
7341 __Pyx_GOTREF(__pyx_t_4);
7342 __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
7343 __pyx_t_20 = PyNumber_Subtract(__pyx_t_4, __pyx_v_init_alg_wall_time);
if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 896, __pyx_L1_error)
7344 __Pyx_GOTREF(__pyx_t_20);
7345 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7346 __pyx_v_alg_wall_time = __pyx_t_20;
7356 __Pyx_TraceLine(898,0,__PYX_ERR(0, 898, __pyx_L1_error))
7357 __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_average_estimates);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 898, __pyx_L1_error)
7358 __Pyx_GOTREF(__pyx_t_4);
7367 __Pyx_TraceLine(900,0,__PYX_ERR(0, 900, __pyx_L1_error))
7368 __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_num_samples_used);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 900, __pyx_L1_error)
7369 __Pyx_GOTREF(__pyx_t_2);
7372 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
7373 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
7374 if (likely(__pyx_t_3)) {
7375 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_4);
7376 __Pyx_INCREF(__pyx_t_3);
7377 __Pyx_INCREF(
function);
7378 __Pyx_DECREF_SET(__pyx_t_4,
function);
7382 #if CYTHON_FAST_PYCALL
7383 if (PyFunction_Check(__pyx_t_4)) {
7384 PyObject *__pyx_temp[7] = {__pyx_t_3, __pyx_v_confidence_level, __pyx_v_outlier_significance_level, __pyx_v_max_num_samples, __pyx_t_2, __pyx_v_processed_samples_indices, __pyx_v_samples};
7385 __pyx_t_20 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_22, 6+__pyx_t_22);
if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 898, __pyx_L1_error)
7386 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
7387 __Pyx_GOTREF(__pyx_t_20);
7388 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7391 #if CYTHON_FAST_PYCCALL
7392 if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
7393 PyObject *__pyx_temp[7] = {__pyx_t_3, __pyx_v_confidence_level, __pyx_v_outlier_significance_level, __pyx_v_max_num_samples, __pyx_t_2, __pyx_v_processed_samples_indices, __pyx_v_samples};
7394 __pyx_t_20 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_22, 6+__pyx_t_22);
if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 898, __pyx_L1_error)
7395 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
7396 __Pyx_GOTREF(__pyx_t_20);
7397 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7401 __pyx_t_5 = PyTuple_New(6+__pyx_t_22);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 898, __pyx_L1_error)
7402 __Pyx_GOTREF(__pyx_t_5);
7404 __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL;
7406 __Pyx_INCREF(__pyx_v_confidence_level);
7407 __Pyx_GIVEREF(__pyx_v_confidence_level);
7408 PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_22, __pyx_v_confidence_level);
7409 __Pyx_INCREF(__pyx_v_outlier_significance_level);
7410 __Pyx_GIVEREF(__pyx_v_outlier_significance_level);
7411 PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_22, __pyx_v_outlier_significance_level);
7412 __Pyx_INCREF(__pyx_v_max_num_samples);
7413 __Pyx_GIVEREF(__pyx_v_max_num_samples);
7414 PyTuple_SET_ITEM(__pyx_t_5, 2+__pyx_t_22, __pyx_v_max_num_samples);
7415 __Pyx_GIVEREF(__pyx_t_2);
7416 PyTuple_SET_ITEM(__pyx_t_5, 3+__pyx_t_22, __pyx_t_2);
7417 __Pyx_INCREF(__pyx_v_processed_samples_indices);
7418 __Pyx_GIVEREF(__pyx_v_processed_samples_indices);
7419 PyTuple_SET_ITEM(__pyx_t_5, 4+__pyx_t_22, __pyx_v_processed_samples_indices);
7420 __Pyx_INCREF(__pyx_v_samples);
7421 __Pyx_GIVEREF(__pyx_v_samples);
7422 PyTuple_SET_ITEM(__pyx_t_5, 5+__pyx_t_22, __pyx_v_samples);
7424 __pyx_t_20 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, NULL);
if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 898, __pyx_L1_error)
7425 __Pyx_GOTREF(__pyx_t_20);
7426 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
7428 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7429 if ((likely(PyTuple_CheckExact(__pyx_t_20))) || (PyList_CheckExact(__pyx_t_20))) {
7430 PyObject* sequence = __pyx_t_20;
7431 Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
7432 if (unlikely(size != 3)) {
7433 if (size > 3) __Pyx_RaiseTooManyValuesError(3);
7434 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
7435 __PYX_ERR(0, 898, __pyx_L1_error)
7437 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
7438 if (likely(PyTuple_CheckExact(sequence))) {
7439 __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0);
7440 __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1);
7441 __pyx_t_2 = PyTuple_GET_ITEM(sequence, 2);
7443 __pyx_t_4 = PyList_GET_ITEM(sequence, 0);
7444 __pyx_t_5 = PyList_GET_ITEM(sequence, 1);
7445 __pyx_t_2 = PyList_GET_ITEM(sequence, 2);
7447 __Pyx_INCREF(__pyx_t_4);
7448 __Pyx_INCREF(__pyx_t_5);
7449 __Pyx_INCREF(__pyx_t_2);
7451 __pyx_t_4 = PySequence_ITEM(sequence, 0);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 898, __pyx_L1_error)
7452 __Pyx_GOTREF(__pyx_t_4);
7453 __pyx_t_5 = PySequence_ITEM(sequence, 1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 898, __pyx_L1_error)
7454 __Pyx_GOTREF(__pyx_t_5);
7455 __pyx_t_2 = PySequence_ITEM(sequence, 2);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 898, __pyx_L1_error)
7456 __Pyx_GOTREF(__pyx_t_2);
7458 __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
7460 Py_ssize_t index = -1;
7461 __pyx_t_3 = PyObject_GetIter(__pyx_t_20);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 898, __pyx_L1_error)
7462 __Pyx_GOTREF(__pyx_t_3);
7463 __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
7464 __pyx_t_21 = Py_TYPE(__pyx_t_3)->tp_iternext;
7465 index = 0; __pyx_t_4 = __pyx_t_21(__pyx_t_3);
if (unlikely(!__pyx_t_4))
goto __pyx_L13_unpacking_failed;
7466 __Pyx_GOTREF(__pyx_t_4);
7467 index = 1; __pyx_t_5 = __pyx_t_21(__pyx_t_3);
if (unlikely(!__pyx_t_5))
goto __pyx_L13_unpacking_failed;
7468 __Pyx_GOTREF(__pyx_t_5);
7469 index = 2; __pyx_t_2 = __pyx_t_21(__pyx_t_3);
if (unlikely(!__pyx_t_2))
goto __pyx_L13_unpacking_failed;
7470 __Pyx_GOTREF(__pyx_t_2);
7471 if (__Pyx_IternextUnpackEndCheck(__pyx_t_21(__pyx_t_3), 3) < 0) __PYX_ERR(0, 898, __pyx_L1_error)
7473 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7474 goto __pyx_L14_unpacking_done;
7475 __pyx_L13_unpacking_failed:;
7476 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7478 if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
7479 __PYX_ERR(0, 898, __pyx_L1_error)
7480 __pyx_L14_unpacking_done:;
7490 __Pyx_TraceLine(898,0,__PYX_ERR(0, 898, __pyx_L1_error))
7491 __pyx_v_trace = __pyx_t_4;
7493 __pyx_v_error = __pyx_t_5;
7495 __pyx_v_num_outliers = __pyx_t_2;
7505 __Pyx_TraceLine(902,0,__PYX_ERR(0, 902, __pyx_L1_error))
7506 __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_time);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 902, __pyx_L1_error)
7507 __Pyx_GOTREF(__pyx_t_2);
7508 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_perf_counter);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 902, __pyx_L1_error)
7509 __Pyx_GOTREF(__pyx_t_5);
7510 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7512 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
7513 __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_5);
7514 if (likely(__pyx_t_2)) {
7515 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_5);
7516 __Pyx_INCREF(__pyx_t_2);
7517 __Pyx_INCREF(
function);
7518 __Pyx_DECREF_SET(__pyx_t_5,
function);
7521 __pyx_t_20 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_5);
7522 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
7523 if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 902, __pyx_L1_error)
7524 __Pyx_GOTREF(__pyx_t_20);
7525 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
7526 __pyx_t_5 = PyNumber_Subtract(__pyx_t_20, __pyx_v_init_tot_wall_time);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 902, __pyx_L1_error)
7527 __Pyx_GOTREF(__pyx_t_5);
7528 __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
7529 __pyx_v_tot_wall_time = __pyx_t_5;
7539 __Pyx_TraceLine(903,0,__PYX_ERR(0, 903, __pyx_L1_error))
7540 __Pyx_GetModuleGlobalName(__pyx_t_20, __pyx_n_s_time);
if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 903, __pyx_L1_error)
7541 __Pyx_GOTREF(__pyx_t_20);
7542 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_20, __pyx_n_s_process_time);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 903, __pyx_L1_error)
7543 __Pyx_GOTREF(__pyx_t_2);
7544 __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
7546 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
7547 __pyx_t_20 = PyMethod_GET_SELF(__pyx_t_2);
7548 if (likely(__pyx_t_20)) {
7549 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_2);
7550 __Pyx_INCREF(__pyx_t_20);
7551 __Pyx_INCREF(
function);
7552 __Pyx_DECREF_SET(__pyx_t_2,
function);
7555 __pyx_t_5 = (__pyx_t_20) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_20) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
7556 __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0;
7557 if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 903, __pyx_L1_error)
7558 __Pyx_GOTREF(__pyx_t_5);
7559 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7560 __pyx_t_2 = PyNumber_Subtract(__pyx_t_5, __pyx_v_init_cpu_proc_time);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 903, __pyx_L1_error)
7561 __Pyx_GOTREF(__pyx_t_2);
7562 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
7563 __pyx_v_cpu_proc_time = __pyx_t_2;
7573 __Pyx_TraceLine(905,0,__PYX_ERR(0, 905, __pyx_L1_error))
7574 __Pyx_XDECREF(__pyx_r);
7583 __Pyx_TraceLine(906,0,__PYX_ERR(0, 906, __pyx_L1_error))
7584 __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_num_processed_samples);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 906, __pyx_L1_error)
7585 __Pyx_GOTREF(__pyx_t_2);
7586 __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_num_samples_used);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 906, __pyx_L1_error)
7587 __Pyx_GOTREF(__pyx_t_5);
7588 __pyx_t_20 = __Pyx_PyInt_From_int(__pyx_v_converged);
if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 906, __pyx_L1_error)
7589 __Pyx_GOTREF(__pyx_t_20);
7598 __Pyx_TraceLine(905,0,__PYX_ERR(0, 905, __pyx_L1_error))
7599 __pyx_t_4 = PyTuple_New(11);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 905, __pyx_L1_error)
7600 __Pyx_GOTREF(__pyx_t_4);
7601 __Pyx_INCREF(__pyx_v_trace);
7602 __Pyx_GIVEREF(__pyx_v_trace);
7603 PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_trace);
7604 __Pyx_INCREF(__pyx_v_error);
7605 __Pyx_GIVEREF(__pyx_v_error);
7606 PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_error);
7607 __Pyx_INCREF(__pyx_v_num_outliers);
7608 __Pyx_GIVEREF(__pyx_v_num_outliers);
7609 PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_num_outliers);
7610 __Pyx_INCREF(__pyx_v_samples);
7611 __Pyx_GIVEREF(__pyx_v_samples);
7612 PyTuple_SET_ITEM(__pyx_t_4, 3, __pyx_v_samples);
7613 __Pyx_INCREF(__pyx_v_processed_samples_indices);
7614 __Pyx_GIVEREF(__pyx_v_processed_samples_indices);
7615 PyTuple_SET_ITEM(__pyx_t_4, 4, __pyx_v_processed_samples_indices);
7616 __Pyx_GIVEREF(__pyx_t_2);
7617 PyTuple_SET_ITEM(__pyx_t_4, 5, __pyx_t_2);
7618 __Pyx_GIVEREF(__pyx_t_5);
7619 PyTuple_SET_ITEM(__pyx_t_4, 6, __pyx_t_5);
7620 __Pyx_GIVEREF(__pyx_t_20);
7621 PyTuple_SET_ITEM(__pyx_t_4, 7, __pyx_t_20);
7622 __Pyx_INCREF(__pyx_v_tot_wall_time);
7623 __Pyx_GIVEREF(__pyx_v_tot_wall_time);
7624 PyTuple_SET_ITEM(__pyx_t_4, 8, __pyx_v_tot_wall_time);
7625 __Pyx_INCREF(__pyx_v_alg_wall_time);
7626 __Pyx_GIVEREF(__pyx_v_alg_wall_time);
7627 PyTuple_SET_ITEM(__pyx_t_4, 9, __pyx_v_alg_wall_time);
7628 __Pyx_INCREF(__pyx_v_cpu_proc_time);
7629 __Pyx_GIVEREF(__pyx_v_cpu_proc_time);
7630 PyTuple_SET_ITEM(__pyx_t_4, 10, __pyx_v_cpu_proc_time);
7634 __pyx_r = __pyx_t_4;
7648 __Pyx_XDECREF(__pyx_t_1);
7649 __Pyx_XDECREF(__pyx_t_2);
7650 __Pyx_XDECREF(__pyx_t_3);
7651 __Pyx_XDECREF(__pyx_t_4);
7652 __Pyx_XDECREF(__pyx_t_5);
7653 __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
7654 __Pyx_XDECREF(__pyx_t_20);
7655 __Pyx_AddTraceback(
"imate.traceinv._hutchinson_method._hutchinson_method_double", __pyx_clineno, __pyx_lineno, __pyx_filename);
7658 __Pyx_XDECREF(__pyx_v_vector_size);
7659 __Pyx_XDECREF(__pyx_v_E);
7660 __PYX_XDEC_MEMVIEW(&__pyx_v_memoryview_E, 1);
7661 __Pyx_XDECREF(__pyx_v_init_tot_wall_time);
7662 __Pyx_XDECREF(__pyx_v_init_cpu_proc_time);
7663 __Pyx_XDECREF(__pyx_v_samples);
7664 __Pyx_XDECREF(__pyx_v_processed_samples_indices);
7665 __Pyx_XDECREF(__pyx_v_init_alg_wall_time);
7666 __Pyx_XDECREF(__pyx_v_AtA);
7667 __Pyx_XDECREF(__pyx_v_i);
7668 __Pyx_XDECREF(__pyx_v_alg_wall_time);
7669 __Pyx_XDECREF(__pyx_v_trace);
7670 __Pyx_XDECREF(__pyx_v_error);
7671 __Pyx_XDECREF(__pyx_v_num_outliers);
7672 __Pyx_XDECREF(__pyx_v_tot_wall_time);
7673 __Pyx_XDECREF(__pyx_v_cpu_proc_time);
7674 __Pyx_XGIVEREF(__pyx_r);
7675 __Pyx_TraceReturn(__pyx_r, 0);
7676 __Pyx_RefNannyFinishContext();
7688 static float __pyx_f_5imate_8traceinv_18_hutchinson_method__stochastic_trace_estimator_float(PyObject *__pyx_v_A, PyObject *__pyx_v_AtA, PyObject *__pyx_v_B, PyObject *__pyx_v_C, PyObject *__pyx_v_E, PyObject *__pyx_v_gram, PyObject *__pyx_v_p, PyObject *__pyx_v_assume_matrix, PyObject *__pyx_v_solver_tol) {
7689 PyObject *__pyx_v_OpE = NULL;
7690 __Pyx_memviewslice __pyx_v_memoryview_E = { 0, 0, { 0 }, { 0 }, { 0 } };
7692 __Pyx_memviewslice __pyx_v_memoryview_OpE = { 0, 0, { 0 }, { 0 }, { 0 } };
7693 float *__pyx_v_cOpE;
7694 int __pyx_v_vector_size;
7695 float __pyx_v_inner_prod;
7696 float __pyx_v_trace_estimate;
7698 __Pyx_TraceDeclarations
7699 __Pyx_RefNannyDeclarations
7703 PyObject *__pyx_t_4 = NULL;
7704 PyObject *__pyx_t_5 = NULL;
7705 PyObject *__pyx_t_6 = NULL;
7707 PyObject *__pyx_t_8 = NULL;
7708 __Pyx_memviewslice __pyx_t_9 = { 0, 0, { 0 }, { 0 }, { 0 } };
7709 Py_ssize_t __pyx_t_10;
7710 int __pyx_lineno = 0;
7711 const char *__pyx_filename = NULL;
7712 int __pyx_clineno = 0;
7713 __Pyx_RefNannySetupContext(
"_stochastic_trace_estimator_float", 0);
7714 __Pyx_TraceCall(
"_stochastic_trace_estimator_float", __pyx_f[0], 914, 0, __PYX_ERR(0, 914, __pyx_L1_error));
7723 __Pyx_TraceLine(953,0,__PYX_ERR(0, 953, __pyx_L1_error))
7724 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_gram);
if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 953, __pyx_L1_error)
7727 __pyx_t_1 = __pyx_t_2;
7728 goto __pyx_L4_bool_binop_done;
7730 __pyx_t_2 = (__pyx_v_AtA == Py_None);
7731 __pyx_t_3 = (__pyx_t_2 != 0);
7732 __pyx_t_1 = __pyx_t_3;
7733 __pyx_L4_bool_binop_done:;
7743 __Pyx_TraceLine(954,0,__PYX_ERR(0, 954, __pyx_L1_error))
7744 __pyx_t_4 = __Pyx_PyInt_EqObjC(__pyx_v_p, __pyx_int_1, 1, 0);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 954, __pyx_L1_error)
7745 __Pyx_GOTREF(__pyx_t_4);
7746 __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4);
if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 954, __pyx_L1_error)
7747 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7750 __pyx_t_1 = __pyx_t_3;
7751 goto __pyx_L7_bool_binop_done;
7753 __pyx_t_3 = (__pyx_v_B == Py_None);
7754 __pyx_t_2 = (__pyx_t_3 != 0);
7757 __pyx_t_1 = __pyx_t_2;
7758 goto __pyx_L7_bool_binop_done;
7760 __pyx_t_2 = (__pyx_v_C == Py_None);
7761 __pyx_t_3 = (__pyx_t_2 != 0);
7762 __pyx_t_1 = __pyx_t_3;
7763 __pyx_L7_bool_binop_done:;
7764 __pyx_t_3 = ((!__pyx_t_1) != 0);
7765 if (unlikely(__pyx_t_3)) {
7774 __Pyx_TraceLine(955,0,__PYX_ERR(0, 955, __pyx_L1_error))
7775 __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__6, NULL);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 955, __pyx_L1_error)
7776 __Pyx_GOTREF(__pyx_t_4);
7777 __Pyx_Raise(__pyx_t_4, 0, 0, 0);
7778 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7779 __PYX_ERR(0, 955, __pyx_L1_error)
7806 __Pyx_TraceLine(958,0,__PYX_ERR(0, 958, __pyx_L1_error))
7807 __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_operator_dot);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 958, __pyx_L1_error)
7808 __Pyx_GOTREF(__pyx_t_5);
7811 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
7812 __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
7813 if (likely(__pyx_t_6)) {
7814 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_5);
7815 __Pyx_INCREF(__pyx_t_6);
7816 __Pyx_INCREF(
function);
7817 __Pyx_DECREF_SET(__pyx_t_5,
function);
7821 #if CYTHON_FAST_PYCALL
7822 if (PyFunction_Check(__pyx_t_5)) {
7823 PyObject *__pyx_temp[9] = {__pyx_t_6, __pyx_v_A, __pyx_v_AtA, __pyx_v_p, __pyx_v_gram, __pyx_v_assume_matrix, __pyx_v_solver_tol, __pyx_v_B, __pyx_v_E};
7824 __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_7, 8+__pyx_t_7);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 958, __pyx_L1_error)
7825 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
7826 __Pyx_GOTREF(__pyx_t_4);
7829 #if CYTHON_FAST_PYCCALL
7830 if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
7831 PyObject *__pyx_temp[9] = {__pyx_t_6, __pyx_v_A, __pyx_v_AtA, __pyx_v_p, __pyx_v_gram, __pyx_v_assume_matrix, __pyx_v_solver_tol, __pyx_v_B, __pyx_v_E};
7832 __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_7, 8+__pyx_t_7);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 958, __pyx_L1_error)
7833 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
7834 __Pyx_GOTREF(__pyx_t_4);
7838 __pyx_t_8 = PyTuple_New(8+__pyx_t_7);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 958, __pyx_L1_error)
7839 __Pyx_GOTREF(__pyx_t_8);
7841 __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6); __pyx_t_6 = NULL;
7843 __Pyx_INCREF(__pyx_v_A);
7844 __Pyx_GIVEREF(__pyx_v_A);
7845 PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_v_A);
7846 __Pyx_INCREF(__pyx_v_AtA);
7847 __Pyx_GIVEREF(__pyx_v_AtA);
7848 PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_v_AtA);
7849 __Pyx_INCREF(__pyx_v_p);
7850 __Pyx_GIVEREF(__pyx_v_p);
7851 PyTuple_SET_ITEM(__pyx_t_8, 2+__pyx_t_7, __pyx_v_p);
7852 __Pyx_INCREF(__pyx_v_gram);
7853 __Pyx_GIVEREF(__pyx_v_gram);
7854 PyTuple_SET_ITEM(__pyx_t_8, 3+__pyx_t_7, __pyx_v_gram);
7855 __Pyx_INCREF(__pyx_v_assume_matrix);
7856 __Pyx_GIVEREF(__pyx_v_assume_matrix);
7857 PyTuple_SET_ITEM(__pyx_t_8, 4+__pyx_t_7, __pyx_v_assume_matrix);
7858 __Pyx_INCREF(__pyx_v_solver_tol);
7859 __Pyx_GIVEREF(__pyx_v_solver_tol);
7860 PyTuple_SET_ITEM(__pyx_t_8, 5+__pyx_t_7, __pyx_v_solver_tol);
7861 __Pyx_INCREF(__pyx_v_B);
7862 __Pyx_GIVEREF(__pyx_v_B);
7863 PyTuple_SET_ITEM(__pyx_t_8, 6+__pyx_t_7, __pyx_v_B);
7864 __Pyx_INCREF(__pyx_v_E);
7865 __Pyx_GIVEREF(__pyx_v_E);
7866 PyTuple_SET_ITEM(__pyx_t_8, 7+__pyx_t_7, __pyx_v_E);
7867 __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_8, NULL);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 958, __pyx_L1_error)
7868 __Pyx_GOTREF(__pyx_t_4);
7869 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
7871 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
7872 __pyx_v_OpE = __pyx_t_4;
7882 __Pyx_TraceLine(961,0,__PYX_ERR(0, 961, __pyx_L1_error))
7883 __pyx_t_3 = (__pyx_v_C != Py_None);
7884 __pyx_t_1 = (__pyx_t_3 != 0);
7894 __Pyx_TraceLine(962,0,__PYX_ERR(0, 962, __pyx_L1_error))
7895 __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_operator_dot);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 962, __pyx_L1_error)
7896 __Pyx_GOTREF(__pyx_t_5);
7899 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
7900 __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_5);
7901 if (likely(__pyx_t_8)) {
7902 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_5);
7903 __Pyx_INCREF(__pyx_t_8);
7904 __Pyx_INCREF(
function);
7905 __Pyx_DECREF_SET(__pyx_t_5,
function);
7909 #if CYTHON_FAST_PYCALL
7910 if (PyFunction_Check(__pyx_t_5)) {
7911 PyObject *__pyx_temp[9] = {__pyx_t_8, __pyx_v_A, __pyx_v_AtA, __pyx_v_p, __pyx_v_gram, __pyx_v_assume_matrix, __pyx_v_solver_tol, __pyx_v_C, __pyx_v_OpE};
7912 __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_7, 8+__pyx_t_7);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 962, __pyx_L1_error)
7913 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
7914 __Pyx_GOTREF(__pyx_t_4);
7917 #if CYTHON_FAST_PYCCALL
7918 if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
7919 PyObject *__pyx_temp[9] = {__pyx_t_8, __pyx_v_A, __pyx_v_AtA, __pyx_v_p, __pyx_v_gram, __pyx_v_assume_matrix, __pyx_v_solver_tol, __pyx_v_C, __pyx_v_OpE};
7920 __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_7, 8+__pyx_t_7);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 962, __pyx_L1_error)
7921 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
7922 __Pyx_GOTREF(__pyx_t_4);
7926 __pyx_t_6 = PyTuple_New(8+__pyx_t_7);
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 962, __pyx_L1_error)
7927 __Pyx_GOTREF(__pyx_t_6);
7929 __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_8); __pyx_t_8 = NULL;
7931 __Pyx_INCREF(__pyx_v_A);
7932 __Pyx_GIVEREF(__pyx_v_A);
7933 PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_7, __pyx_v_A);
7934 __Pyx_INCREF(__pyx_v_AtA);
7935 __Pyx_GIVEREF(__pyx_v_AtA);
7936 PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_7, __pyx_v_AtA);
7937 __Pyx_INCREF(__pyx_v_p);
7938 __Pyx_GIVEREF(__pyx_v_p);
7939 PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_7, __pyx_v_p);
7940 __Pyx_INCREF(__pyx_v_gram);
7941 __Pyx_GIVEREF(__pyx_v_gram);
7942 PyTuple_SET_ITEM(__pyx_t_6, 3+__pyx_t_7, __pyx_v_gram);
7943 __Pyx_INCREF(__pyx_v_assume_matrix);
7944 __Pyx_GIVEREF(__pyx_v_assume_matrix);
7945 PyTuple_SET_ITEM(__pyx_t_6, 4+__pyx_t_7, __pyx_v_assume_matrix);
7946 __Pyx_INCREF(__pyx_v_solver_tol);
7947 __Pyx_GIVEREF(__pyx_v_solver_tol);
7948 PyTuple_SET_ITEM(__pyx_t_6, 5+__pyx_t_7, __pyx_v_solver_tol);
7949 __Pyx_INCREF(__pyx_v_C);
7950 __Pyx_GIVEREF(__pyx_v_C);
7951 PyTuple_SET_ITEM(__pyx_t_6, 6+__pyx_t_7, __pyx_v_C);
7952 __Pyx_INCREF(__pyx_v_OpE);
7953 __Pyx_GIVEREF(__pyx_v_OpE);
7954 PyTuple_SET_ITEM(__pyx_t_6, 7+__pyx_t_7, __pyx_v_OpE);
7955 __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_6, NULL);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 962, __pyx_L1_error)
7956 __Pyx_GOTREF(__pyx_t_4);
7957 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
7959 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
7960 __Pyx_DECREF_SET(__pyx_v_OpE, __pyx_t_4);
7979 __Pyx_TraceLine(965,0,__PYX_ERR(0, 965, __pyx_L1_error))
7980 __pyx_t_9 = __Pyx_PyObject_to_MemoryviewSlice_ds_float(__pyx_v_E, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_9.memview)) __PYX_ERR(0, 965, __pyx_L1_error)
7981 __pyx_v_memoryview_E = __pyx_t_9;
7982 __pyx_t_9.memview = NULL;
7983 __pyx_t_9.data = NULL;
7992 __Pyx_TraceLine(966,0,__PYX_ERR(0, 966, __pyx_L1_error))
7994 __pyx_v_cE = (&(*((
float *) ( (__pyx_v_memoryview_E.data + __pyx_t_10 * __pyx_v_memoryview_E.strides[0]) ))));
8003 __Pyx_TraceLine(969,0,__PYX_ERR(0, 969, __pyx_L1_error))
8004 __pyx_t_9 = __Pyx_PyObject_to_MemoryviewSlice_ds_float(__pyx_v_OpE, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_9.memview)) __PYX_ERR(0, 969, __pyx_L1_error)
8005 __pyx_v_memoryview_OpE = __pyx_t_9;
8006 __pyx_t_9.memview = NULL;
8007 __pyx_t_9.data = NULL;
8016 __Pyx_TraceLine(970,0,__PYX_ERR(0, 970, __pyx_L1_error))
8018 __pyx_v_cOpE = (&(*((
float *) ( (__pyx_v_memoryview_OpE.data + __pyx_t_10 * __pyx_v_memoryview_OpE.strides[0]) ))));
8027 __Pyx_TraceLine(973,0,__PYX_ERR(0, 973, __pyx_L1_error))
8028 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_shape);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 973, __pyx_L1_error)
8029 __Pyx_GOTREF(__pyx_t_4);
8030 __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_4, 0,
long, 1, __Pyx_PyInt_From_long, 0, 0, 0);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 973, __pyx_L1_error)
8031 __Pyx_GOTREF(__pyx_t_5);
8032 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8033 __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_t_5);
if (unlikely((__pyx_t_7 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 973, __pyx_L1_error)
8034 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8035 __pyx_v_vector_size = __pyx_t_7;
8044 __Pyx_TraceLine(976,0,__PYX_ERR(0, 976, __pyx_L1_error))
8045 __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_gram);
if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 976, __pyx_L1_error)
8048 __pyx_t_1 = __pyx_t_3;
8049 goto __pyx_L12_bool_binop_done;
8051 __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_numpy);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 976, __pyx_L1_error)
8052 __Pyx_GOTREF(__pyx_t_4);
8053 __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_abs);
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 976, __pyx_L1_error)
8054 __Pyx_GOTREF(__pyx_t_6);
8055 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8057 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
8058 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6);
8059 if (likely(__pyx_t_4)) {
8060 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_6);
8061 __Pyx_INCREF(__pyx_t_4);
8062 __Pyx_INCREF(
function);
8063 __Pyx_DECREF_SET(__pyx_t_6,
function);
8066 __pyx_t_5 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_4, __pyx_v_p) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_p);
8067 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
8068 if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 976, __pyx_L1_error)
8069 __Pyx_GOTREF(__pyx_t_5);
8070 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
8071 __pyx_t_6 = __Pyx_PyInt_EqObjC(__pyx_t_5, __pyx_int_1, 1, 0);
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 976, __pyx_L1_error)
8072 __Pyx_GOTREF(__pyx_t_6);
8073 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8074 __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_6);
if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 976, __pyx_L1_error)
8075 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
8078 __pyx_t_1 = __pyx_t_3;
8079 goto __pyx_L12_bool_binop_done;
8081 __pyx_t_3 = (__pyx_v_B == Py_None);
8082 __pyx_t_2 = (__pyx_t_3 != 0);
8085 __pyx_t_1 = __pyx_t_2;
8086 goto __pyx_L12_bool_binop_done;
8088 __pyx_t_2 = (__pyx_v_C == Py_None);
8089 __pyx_t_3 = (__pyx_t_2 != 0);
8090 __pyx_t_1 = __pyx_t_3;
8091 __pyx_L12_bool_binop_done:;
8101 __Pyx_TraceLine(977,0,__PYX_ERR(0, 977, __pyx_L1_error))
8121 __Pyx_TraceLine(980,0,__PYX_ERR(0, 980, __pyx_L1_error))
8131 __Pyx_TraceLine(981,0,__PYX_ERR(0, 981, __pyx_L1_error))
8143 __Pyx_TraceLine(984,0,__PYX_ERR(0, 984, __pyx_L1_error))
8144 __pyx_v_trace_estimate = (__pyx_v_vector_size * __pyx_v_inner_prod);
8153 __Pyx_TraceLine(986,0,__PYX_ERR(0, 986, __pyx_L1_error))
8154 __pyx_r = __pyx_v_trace_estimate;
8167 __Pyx_XDECREF(__pyx_t_4);
8168 __Pyx_XDECREF(__pyx_t_5);
8169 __Pyx_XDECREF(__pyx_t_6);
8170 __Pyx_XDECREF(__pyx_t_8);
8171 __PYX_XDEC_MEMVIEW(&__pyx_t_9, 1);
8172 __Pyx_AddTraceback(
"imate.traceinv._hutchinson_method._stochastic_trace_estimator_float", __pyx_clineno, __pyx_lineno, __pyx_filename);
8175 __Pyx_XDECREF(__pyx_v_OpE);
8176 __PYX_XDEC_MEMVIEW(&__pyx_v_memoryview_E, 1);
8177 __PYX_XDEC_MEMVIEW(&__pyx_v_memoryview_OpE, 1);
8178 __Pyx_TraceReturn(Py_None, 0);
8179 __Pyx_RefNannyFinishContext();
8191 static double __pyx_f_5imate_8traceinv_18_hutchinson_method__stochastic_trace_estimator_double(PyObject *__pyx_v_A, PyObject *__pyx_v_AtA, PyObject *__pyx_v_B, PyObject *__pyx_v_C, PyObject *__pyx_v_E, PyObject *__pyx_v_gram, PyObject *__pyx_v_p, PyObject *__pyx_v_assume_matrix, PyObject *__pyx_v_solver_tol) {
8192 PyObject *__pyx_v_OpE = NULL;
8193 __Pyx_memviewslice __pyx_v_memoryview_E = { 0, 0, { 0 }, { 0 }, { 0 } };
8195 __Pyx_memviewslice __pyx_v_memoryview_OpE = { 0, 0, { 0 }, { 0 }, { 0 } };
8196 double *__pyx_v_cOpE;
8197 int __pyx_v_vector_size;
8198 double __pyx_v_inner_prod;
8199 double __pyx_v_trace_estimate;
8201 __Pyx_TraceDeclarations
8202 __Pyx_RefNannyDeclarations
8206 PyObject *__pyx_t_4 = NULL;
8207 PyObject *__pyx_t_5 = NULL;
8208 PyObject *__pyx_t_6 = NULL;
8210 PyObject *__pyx_t_8 = NULL;
8211 __Pyx_memviewslice __pyx_t_9 = { 0, 0, { 0 }, { 0 }, { 0 } };
8212 Py_ssize_t __pyx_t_10;
8213 int __pyx_lineno = 0;
8214 const char *__pyx_filename = NULL;
8215 int __pyx_clineno = 0;
8216 __Pyx_RefNannySetupContext(
"_stochastic_trace_estimator_double", 0);
8217 __Pyx_TraceCall(
"_stochastic_trace_estimator_double", __pyx_f[0], 993, 0, __PYX_ERR(0, 993, __pyx_L1_error));
8226 __Pyx_TraceLine(1032,0,__PYX_ERR(0, 1032, __pyx_L1_error))
8227 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_gram);
if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 1032, __pyx_L1_error)
8230 __pyx_t_1 = __pyx_t_2;
8231 goto __pyx_L4_bool_binop_done;
8233 __pyx_t_2 = (__pyx_v_AtA == Py_None);
8234 __pyx_t_3 = (__pyx_t_2 != 0);
8235 __pyx_t_1 = __pyx_t_3;
8236 __pyx_L4_bool_binop_done:;
8246 __Pyx_TraceLine(1033,0,__PYX_ERR(0, 1033, __pyx_L1_error))
8247 __pyx_t_4 = __Pyx_PyInt_EqObjC(__pyx_v_p, __pyx_int_1, 1, 0);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1033, __pyx_L1_error)
8248 __Pyx_GOTREF(__pyx_t_4);
8249 __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4);
if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 1033, __pyx_L1_error)
8250 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8253 __pyx_t_1 = __pyx_t_3;
8254 goto __pyx_L7_bool_binop_done;
8256 __pyx_t_3 = (__pyx_v_B == Py_None);
8257 __pyx_t_2 = (__pyx_t_3 != 0);
8260 __pyx_t_1 = __pyx_t_2;
8261 goto __pyx_L7_bool_binop_done;
8263 __pyx_t_2 = (__pyx_v_C == Py_None);
8264 __pyx_t_3 = (__pyx_t_2 != 0);
8265 __pyx_t_1 = __pyx_t_3;
8266 __pyx_L7_bool_binop_done:;
8267 __pyx_t_3 = ((!__pyx_t_1) != 0);
8268 if (unlikely(__pyx_t_3)) {
8277 __Pyx_TraceLine(1034,0,__PYX_ERR(0, 1034, __pyx_L1_error))
8278 __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__6, NULL);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1034, __pyx_L1_error)
8279 __Pyx_GOTREF(__pyx_t_4);
8280 __Pyx_Raise(__pyx_t_4, 0, 0, 0);
8281 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8282 __PYX_ERR(0, 1034, __pyx_L1_error)
8309 __Pyx_TraceLine(1037,0,__PYX_ERR(0, 1037, __pyx_L1_error))
8310 __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_operator_dot);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1037, __pyx_L1_error)
8311 __Pyx_GOTREF(__pyx_t_5);
8314 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
8315 __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
8316 if (likely(__pyx_t_6)) {
8317 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_5);
8318 __Pyx_INCREF(__pyx_t_6);
8319 __Pyx_INCREF(
function);
8320 __Pyx_DECREF_SET(__pyx_t_5,
function);
8324 #if CYTHON_FAST_PYCALL
8325 if (PyFunction_Check(__pyx_t_5)) {
8326 PyObject *__pyx_temp[9] = {__pyx_t_6, __pyx_v_A, __pyx_v_AtA, __pyx_v_p, __pyx_v_gram, __pyx_v_assume_matrix, __pyx_v_solver_tol, __pyx_v_B, __pyx_v_E};
8327 __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_7, 8+__pyx_t_7);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1037, __pyx_L1_error)
8328 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
8329 __Pyx_GOTREF(__pyx_t_4);
8332 #if CYTHON_FAST_PYCCALL
8333 if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
8334 PyObject *__pyx_temp[9] = {__pyx_t_6, __pyx_v_A, __pyx_v_AtA, __pyx_v_p, __pyx_v_gram, __pyx_v_assume_matrix, __pyx_v_solver_tol, __pyx_v_B, __pyx_v_E};
8335 __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_7, 8+__pyx_t_7);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1037, __pyx_L1_error)
8336 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
8337 __Pyx_GOTREF(__pyx_t_4);
8341 __pyx_t_8 = PyTuple_New(8+__pyx_t_7);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1037, __pyx_L1_error)
8342 __Pyx_GOTREF(__pyx_t_8);
8344 __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6); __pyx_t_6 = NULL;
8346 __Pyx_INCREF(__pyx_v_A);
8347 __Pyx_GIVEREF(__pyx_v_A);
8348 PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_v_A);
8349 __Pyx_INCREF(__pyx_v_AtA);
8350 __Pyx_GIVEREF(__pyx_v_AtA);
8351 PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_v_AtA);
8352 __Pyx_INCREF(__pyx_v_p);
8353 __Pyx_GIVEREF(__pyx_v_p);
8354 PyTuple_SET_ITEM(__pyx_t_8, 2+__pyx_t_7, __pyx_v_p);
8355 __Pyx_INCREF(__pyx_v_gram);
8356 __Pyx_GIVEREF(__pyx_v_gram);
8357 PyTuple_SET_ITEM(__pyx_t_8, 3+__pyx_t_7, __pyx_v_gram);
8358 __Pyx_INCREF(__pyx_v_assume_matrix);
8359 __Pyx_GIVEREF(__pyx_v_assume_matrix);
8360 PyTuple_SET_ITEM(__pyx_t_8, 4+__pyx_t_7, __pyx_v_assume_matrix);
8361 __Pyx_INCREF(__pyx_v_solver_tol);
8362 __Pyx_GIVEREF(__pyx_v_solver_tol);
8363 PyTuple_SET_ITEM(__pyx_t_8, 5+__pyx_t_7, __pyx_v_solver_tol);
8364 __Pyx_INCREF(__pyx_v_B);
8365 __Pyx_GIVEREF(__pyx_v_B);
8366 PyTuple_SET_ITEM(__pyx_t_8, 6+__pyx_t_7, __pyx_v_B);
8367 __Pyx_INCREF(__pyx_v_E);
8368 __Pyx_GIVEREF(__pyx_v_E);
8369 PyTuple_SET_ITEM(__pyx_t_8, 7+__pyx_t_7, __pyx_v_E);
8370 __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_8, NULL);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1037, __pyx_L1_error)
8371 __Pyx_GOTREF(__pyx_t_4);
8372 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
8374 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8375 __pyx_v_OpE = __pyx_t_4;
8385 __Pyx_TraceLine(1040,0,__PYX_ERR(0, 1040, __pyx_L1_error))
8386 __pyx_t_3 = (__pyx_v_C != Py_None);
8387 __pyx_t_1 = (__pyx_t_3 != 0);
8397 __Pyx_TraceLine(1041,0,__PYX_ERR(0, 1041, __pyx_L1_error))
8398 __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_operator_dot);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1041, __pyx_L1_error)
8399 __Pyx_GOTREF(__pyx_t_5);
8402 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
8403 __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_5);
8404 if (likely(__pyx_t_8)) {
8405 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_5);
8406 __Pyx_INCREF(__pyx_t_8);
8407 __Pyx_INCREF(
function);
8408 __Pyx_DECREF_SET(__pyx_t_5,
function);
8412 #if CYTHON_FAST_PYCALL
8413 if (PyFunction_Check(__pyx_t_5)) {
8414 PyObject *__pyx_temp[9] = {__pyx_t_8, __pyx_v_A, __pyx_v_AtA, __pyx_v_p, __pyx_v_gram, __pyx_v_assume_matrix, __pyx_v_solver_tol, __pyx_v_C, __pyx_v_OpE};
8415 __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_7, 8+__pyx_t_7);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1041, __pyx_L1_error)
8416 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
8417 __Pyx_GOTREF(__pyx_t_4);
8420 #if CYTHON_FAST_PYCCALL
8421 if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
8422 PyObject *__pyx_temp[9] = {__pyx_t_8, __pyx_v_A, __pyx_v_AtA, __pyx_v_p, __pyx_v_gram, __pyx_v_assume_matrix, __pyx_v_solver_tol, __pyx_v_C, __pyx_v_OpE};
8423 __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_7, 8+__pyx_t_7);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1041, __pyx_L1_error)
8424 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
8425 __Pyx_GOTREF(__pyx_t_4);
8429 __pyx_t_6 = PyTuple_New(8+__pyx_t_7);
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1041, __pyx_L1_error)
8430 __Pyx_GOTREF(__pyx_t_6);
8432 __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_8); __pyx_t_8 = NULL;
8434 __Pyx_INCREF(__pyx_v_A);
8435 __Pyx_GIVEREF(__pyx_v_A);
8436 PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_7, __pyx_v_A);
8437 __Pyx_INCREF(__pyx_v_AtA);
8438 __Pyx_GIVEREF(__pyx_v_AtA);
8439 PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_7, __pyx_v_AtA);
8440 __Pyx_INCREF(__pyx_v_p);
8441 __Pyx_GIVEREF(__pyx_v_p);
8442 PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_7, __pyx_v_p);
8443 __Pyx_INCREF(__pyx_v_gram);
8444 __Pyx_GIVEREF(__pyx_v_gram);
8445 PyTuple_SET_ITEM(__pyx_t_6, 3+__pyx_t_7, __pyx_v_gram);
8446 __Pyx_INCREF(__pyx_v_assume_matrix);
8447 __Pyx_GIVEREF(__pyx_v_assume_matrix);
8448 PyTuple_SET_ITEM(__pyx_t_6, 4+__pyx_t_7, __pyx_v_assume_matrix);
8449 __Pyx_INCREF(__pyx_v_solver_tol);
8450 __Pyx_GIVEREF(__pyx_v_solver_tol);
8451 PyTuple_SET_ITEM(__pyx_t_6, 5+__pyx_t_7, __pyx_v_solver_tol);
8452 __Pyx_INCREF(__pyx_v_C);
8453 __Pyx_GIVEREF(__pyx_v_C);
8454 PyTuple_SET_ITEM(__pyx_t_6, 6+__pyx_t_7, __pyx_v_C);
8455 __Pyx_INCREF(__pyx_v_OpE);
8456 __Pyx_GIVEREF(__pyx_v_OpE);
8457 PyTuple_SET_ITEM(__pyx_t_6, 7+__pyx_t_7, __pyx_v_OpE);
8458 __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_6, NULL);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1041, __pyx_L1_error)
8459 __Pyx_GOTREF(__pyx_t_4);
8460 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
8462 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8463 __Pyx_DECREF_SET(__pyx_v_OpE, __pyx_t_4);
8482 __Pyx_TraceLine(1044,0,__PYX_ERR(0, 1044, __pyx_L1_error))
8483 __pyx_t_9 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_E, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_9.memview)) __PYX_ERR(0, 1044, __pyx_L1_error)
8484 __pyx_v_memoryview_E = __pyx_t_9;
8485 __pyx_t_9.memview = NULL;
8486 __pyx_t_9.data = NULL;
8495 __Pyx_TraceLine(1045,0,__PYX_ERR(0, 1045, __pyx_L1_error))
8497 __pyx_v_cE = (&(*((
double *) ( (__pyx_v_memoryview_E.data + __pyx_t_10 * __pyx_v_memoryview_E.strides[0]) ))));
8506 __Pyx_TraceLine(1048,0,__PYX_ERR(0, 1048, __pyx_L1_error))
8507 __pyx_t_9 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_OpE, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_9.memview)) __PYX_ERR(0, 1048, __pyx_L1_error)
8508 __pyx_v_memoryview_OpE = __pyx_t_9;
8509 __pyx_t_9.memview = NULL;
8510 __pyx_t_9.data = NULL;
8519 __Pyx_TraceLine(1049,0,__PYX_ERR(0, 1049, __pyx_L1_error))
8521 __pyx_v_cOpE = (&(*((
double *) ( (__pyx_v_memoryview_OpE.data + __pyx_t_10 * __pyx_v_memoryview_OpE.strides[0]) ))));
8530 __Pyx_TraceLine(1052,0,__PYX_ERR(0, 1052, __pyx_L1_error))
8531 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_shape);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1052, __pyx_L1_error)
8532 __Pyx_GOTREF(__pyx_t_4);
8533 __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_4, 0,
long, 1, __Pyx_PyInt_From_long, 0, 0, 0);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1052, __pyx_L1_error)
8534 __Pyx_GOTREF(__pyx_t_5);
8535 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8536 __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_t_5);
if (unlikely((__pyx_t_7 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1052, __pyx_L1_error)
8537 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8538 __pyx_v_vector_size = __pyx_t_7;
8547 __Pyx_TraceLine(1055,0,__PYX_ERR(0, 1055, __pyx_L1_error))
8548 __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_gram);
if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 1055, __pyx_L1_error)
8551 __pyx_t_1 = __pyx_t_3;
8552 goto __pyx_L12_bool_binop_done;
8554 __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_numpy);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1055, __pyx_L1_error)
8555 __Pyx_GOTREF(__pyx_t_4);
8556 __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_abs);
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1055, __pyx_L1_error)
8557 __Pyx_GOTREF(__pyx_t_6);
8558 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8560 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
8561 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6);
8562 if (likely(__pyx_t_4)) {
8563 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_6);
8564 __Pyx_INCREF(__pyx_t_4);
8565 __Pyx_INCREF(
function);
8566 __Pyx_DECREF_SET(__pyx_t_6,
function);
8569 __pyx_t_5 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_4, __pyx_v_p) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_p);
8570 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
8571 if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1055, __pyx_L1_error)
8572 __Pyx_GOTREF(__pyx_t_5);
8573 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
8574 __pyx_t_6 = __Pyx_PyInt_EqObjC(__pyx_t_5, __pyx_int_1, 1, 0);
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1055, __pyx_L1_error)
8575 __Pyx_GOTREF(__pyx_t_6);
8576 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8577 __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_6);
if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 1055, __pyx_L1_error)
8578 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
8581 __pyx_t_1 = __pyx_t_3;
8582 goto __pyx_L12_bool_binop_done;
8584 __pyx_t_3 = (__pyx_v_B == Py_None);
8585 __pyx_t_2 = (__pyx_t_3 != 0);
8588 __pyx_t_1 = __pyx_t_2;
8589 goto __pyx_L12_bool_binop_done;
8591 __pyx_t_2 = (__pyx_v_C == Py_None);
8592 __pyx_t_3 = (__pyx_t_2 != 0);
8593 __pyx_t_1 = __pyx_t_3;
8594 __pyx_L12_bool_binop_done:;
8604 __Pyx_TraceLine(1056,0,__PYX_ERR(0, 1056, __pyx_L1_error))
8624 __Pyx_TraceLine(1059,0,__PYX_ERR(0, 1059, __pyx_L1_error))
8634 __Pyx_TraceLine(1060,0,__PYX_ERR(0, 1060, __pyx_L1_error))
8646 __Pyx_TraceLine(1063,0,__PYX_ERR(0, 1063, __pyx_L1_error))
8647 __pyx_v_trace_estimate = (__pyx_v_vector_size * __pyx_v_inner_prod);
8656 __Pyx_TraceLine(1065,0,__PYX_ERR(0, 1065, __pyx_L1_error))
8657 __pyx_r = __pyx_v_trace_estimate;
8670 __Pyx_XDECREF(__pyx_t_4);
8671 __Pyx_XDECREF(__pyx_t_5);
8672 __Pyx_XDECREF(__pyx_t_6);
8673 __Pyx_XDECREF(__pyx_t_8);
8674 __PYX_XDEC_MEMVIEW(&__pyx_t_9, 1);
8675 __Pyx_AddTraceback(
"imate.traceinv._hutchinson_method._stochastic_trace_estimator_double", __pyx_clineno, __pyx_lineno, __pyx_filename);
8678 __Pyx_XDECREF(__pyx_v_OpE);
8679 __PYX_XDEC_MEMVIEW(&__pyx_v_memoryview_E, 1);
8680 __PYX_XDEC_MEMVIEW(&__pyx_v_memoryview_OpE, 1);
8681 __Pyx_TraceReturn(Py_None, 0);
8682 __Pyx_RefNannyFinishContext();
8695 static PyObject *__pyx_pw_5imate_8traceinv_18_hutchinson_method_7_operator_dot(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
8696 static char __pyx_doc_5imate_8traceinv_18_hutchinson_method_6_operator_dot[] =
"_operator_dot(A, AtA, p, gram, assume_matrix, solver_tol, B, E)\n\n Computes either of the followings:\n\n * Ainv * B * E\n * (Ainv ** p) * B * E\n * AtA * B * E\n * (AtA ** p) * B * E\n ";
8697 static PyMethodDef __pyx_mdef_5imate_8traceinv_18_hutchinson_method_7_operator_dot = {
"_operator_dot", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_5imate_8traceinv_18_hutchinson_method_7_operator_dot, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5imate_8traceinv_18_hutchinson_method_6_operator_dot};
8698 static PyObject *__pyx_pw_5imate_8traceinv_18_hutchinson_method_7_operator_dot(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
8699 PyObject *__pyx_v_A = 0;
8700 PyObject *__pyx_v_AtA = 0;
8701 PyObject *__pyx_v_p = 0;
8702 PyObject *__pyx_v_gram = 0;
8703 PyObject *__pyx_v_assume_matrix = 0;
8704 PyObject *__pyx_v_solver_tol = 0;
8705 PyObject *__pyx_v_B = 0;
8706 PyObject *__pyx_v_E = 0;
8707 int __pyx_lineno = 0;
8708 const char *__pyx_filename = NULL;
8709 int __pyx_clineno = 0;
8710 PyObject *__pyx_r = 0;
8711 __Pyx_RefNannyDeclarations
8712 __Pyx_RefNannySetupContext(
"_operator_dot (wrapper)", 0);
8714 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_A,&__pyx_n_s_AtA,&__pyx_n_s_p,&__pyx_n_s_gram,&__pyx_n_s_assume_matrix,&__pyx_n_s_solver_tol,&__pyx_n_s_B,&__pyx_n_s_E,0};
8715 PyObject* values[8] = {0,0,0,0,0,0,0,0};
8716 if (unlikely(__pyx_kwds)) {
8718 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
8720 case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
8722 case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
8724 case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
8726 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
8728 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
8730 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
8732 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
8734 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
8737 default:
goto __pyx_L5_argtuple_error;
8739 kw_args = PyDict_Size(__pyx_kwds);
8742 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_A)) != 0)) kw_args--;
8743 else goto __pyx_L5_argtuple_error;
8746 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_AtA)) != 0)) kw_args--;
8748 __Pyx_RaiseArgtupleInvalid(
"_operator_dot", 1, 8, 8, 1); __PYX_ERR(0, 1072, __pyx_L3_error)
8752 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_p)) != 0)) kw_args--;
8754 __Pyx_RaiseArgtupleInvalid(
"_operator_dot", 1, 8, 8, 2); __PYX_ERR(0, 1072, __pyx_L3_error)
8758 if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_gram)) != 0)) kw_args--;
8760 __Pyx_RaiseArgtupleInvalid(
"_operator_dot", 1, 8, 8, 3); __PYX_ERR(0, 1072, __pyx_L3_error)
8764 if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_assume_matrix)) != 0)) kw_args--;
8766 __Pyx_RaiseArgtupleInvalid(
"_operator_dot", 1, 8, 8, 4); __PYX_ERR(0, 1072, __pyx_L3_error)
8770 if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_solver_tol)) != 0)) kw_args--;
8772 __Pyx_RaiseArgtupleInvalid(
"_operator_dot", 1, 8, 8, 5); __PYX_ERR(0, 1072, __pyx_L3_error)
8776 if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_B)) != 0)) kw_args--;
8778 __Pyx_RaiseArgtupleInvalid(
"_operator_dot", 1, 8, 8, 6); __PYX_ERR(0, 1072, __pyx_L3_error)
8782 if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_E)) != 0)) kw_args--;
8784 __Pyx_RaiseArgtupleInvalid(
"_operator_dot", 1, 8, 8, 7); __PYX_ERR(0, 1072, __pyx_L3_error)
8787 if (unlikely(kw_args > 0)) {
8788 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"_operator_dot") < 0)) __PYX_ERR(0, 1072, __pyx_L3_error)
8790 }
else if (PyTuple_GET_SIZE(__pyx_args) != 8) {
8791 goto __pyx_L5_argtuple_error;
8793 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
8794 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
8795 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
8796 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
8797 values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
8798 values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
8799 values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
8800 values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
8802 __pyx_v_A = values[0];
8803 __pyx_v_AtA = values[1];
8804 __pyx_v_p = values[2];
8805 __pyx_v_gram = values[3];
8806 __pyx_v_assume_matrix = values[4];
8807 __pyx_v_solver_tol = values[5];
8808 __pyx_v_B = values[6];
8809 __pyx_v_E = values[7];
8811 goto __pyx_L4_argument_unpacking_done;
8812 __pyx_L5_argtuple_error:;
8813 __Pyx_RaiseArgtupleInvalid(
"_operator_dot", 1, 8, 8, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1072, __pyx_L3_error)
8815 __Pyx_AddTraceback(
"imate.traceinv._hutchinson_method._operator_dot", __pyx_clineno, __pyx_lineno, __pyx_filename);
8816 __Pyx_RefNannyFinishContext();
8818 __pyx_L4_argument_unpacking_done:;
8819 __pyx_r = __pyx_pf_5imate_8traceinv_18_hutchinson_method_6_operator_dot(__pyx_self, __pyx_v_A, __pyx_v_AtA, __pyx_v_p, __pyx_v_gram, __pyx_v_assume_matrix, __pyx_v_solver_tol, __pyx_v_B, __pyx_v_E);
8822 __Pyx_RefNannyFinishContext();
8826 static PyObject *__pyx_pf_5imate_8traceinv_18_hutchinson_method_6_operator_dot(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_AtA, PyObject *__pyx_v_p, PyObject *__pyx_v_gram, PyObject *__pyx_v_assume_matrix, PyObject *__pyx_v_solver_tol, PyObject *__pyx_v_B, PyObject *__pyx_v_E) {
8827 PyObject *__pyx_v_BE = NULL;
8828 PyObject *__pyx_v_OpE = NULL;
8829 CYTHON_UNUSED PyObject *__pyx_v_i = NULL;
8830 CYTHON_UNUSED PyObject *__pyx_v_AinvpE = NULL;
8831 PyObject *__pyx_r = NULL;
8832 __Pyx_TraceDeclarations
8833 __Pyx_RefNannyDeclarations
8836 PyObject *__pyx_t_3 = NULL;
8837 PyObject *__pyx_t_4 = NULL;
8838 PyObject *__pyx_t_5 = NULL;
8839 PyObject *__pyx_t_6 = NULL;
8841 PyObject *__pyx_t_8 = NULL;
8842 Py_ssize_t __pyx_t_9;
8843 PyObject *(*__pyx_t_10)(PyObject *);
8844 int __pyx_lineno = 0;
8845 const char *__pyx_filename = NULL;
8846 int __pyx_clineno = 0;
8847 __Pyx_TraceFrameInit(__pyx_codeobj__7)
8848 __Pyx_RefNannySetupContext(
"_operator_dot", 0);
8849 __Pyx_TraceCall(
"_operator_dot", __pyx_f[0], 1072, 0, __PYX_ERR(0, 1072, __pyx_L1_error));
8858 __Pyx_TraceLine(1083,0,__PYX_ERR(0, 1083, __pyx_L1_error))
8859 __pyx_t_1 = (__pyx_v_B != Py_None);
8860 __pyx_t_2 = (__pyx_t_1 != 0);
8870 __Pyx_TraceLine(1084,0,__PYX_ERR(0, 1084, __pyx_L1_error))
8871 __pyx_t_3 = __Pyx_PyNumber_MatrixMultiply(__pyx_v_B, __pyx_v_E);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1084, __pyx_L1_error)
8872 __Pyx_GOTREF(__pyx_t_3);
8873 __pyx_v_BE = __pyx_t_3;
8893 __Pyx_TraceLine(1087,0,__PYX_ERR(0, 1087, __pyx_L1_error))
8895 __Pyx_INCREF(__pyx_v_E);
8896 __pyx_v_BE = __pyx_v_E;
8907 __Pyx_TraceLine(1092,0,__PYX_ERR(0, 1092, __pyx_L1_error))
8908 __pyx_t_3 = __Pyx_PyInt_EqObjC(__pyx_v_p, __pyx_int_0, 0, 0);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1092, __pyx_L1_error)
8909 __Pyx_GOTREF(__pyx_t_3);
8910 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3);
if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 1092, __pyx_L1_error)
8911 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8921 __Pyx_TraceLine(1094,0,__PYX_ERR(0, 1094, __pyx_L1_error))
8922 __Pyx_INCREF(__pyx_v_BE);
8923 __pyx_v_OpE = __pyx_v_BE;
8942 __Pyx_TraceLine(1096,0,__PYX_ERR(0, 1096, __pyx_L1_error))
8943 __pyx_t_3 = __Pyx_PyInt_EqObjC(__pyx_v_p, __pyx_int_1, 1, 0);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1096, __pyx_L1_error)
8944 __Pyx_GOTREF(__pyx_t_3);
8945 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3);
if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 1096, __pyx_L1_error)
8946 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8956 __Pyx_TraceLine(1098,0,__PYX_ERR(0, 1098, __pyx_L1_error))
8957 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_gram);
if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 1098, __pyx_L1_error)
8967 __Pyx_TraceLine(1099,0,__PYX_ERR(0, 1099, __pyx_L1_error))
8968 __pyx_t_2 = (__pyx_v_B == Py_None);
8969 __pyx_t_1 = (__pyx_t_2 != 0);
8979 __Pyx_TraceLine(1100,0,__PYX_ERR(0, 1100, __pyx_L1_error))
8980 __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_linear_solver);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1100, __pyx_L1_error)
8981 __Pyx_GOTREF(__pyx_t_4);
8982 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_T);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1100, __pyx_L1_error)
8983 __Pyx_GOTREF(__pyx_t_5);
8986 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
8987 __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
8988 if (likely(__pyx_t_6)) {
8989 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_4);
8990 __Pyx_INCREF(__pyx_t_6);
8991 __Pyx_INCREF(
function);
8992 __Pyx_DECREF_SET(__pyx_t_4,
function);
8996 #if CYTHON_FAST_PYCALL
8997 if (PyFunction_Check(__pyx_t_4)) {
8998 PyObject *__pyx_temp[5] = {__pyx_t_6, __pyx_t_5, __pyx_v_BE, __pyx_v_assume_matrix, __pyx_v_solver_tol};
8999 __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_7, 4+__pyx_t_7);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1100, __pyx_L1_error)
9000 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
9001 __Pyx_GOTREF(__pyx_t_3);
9002 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
9005 #if CYTHON_FAST_PYCCALL
9006 if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
9007 PyObject *__pyx_temp[5] = {__pyx_t_6, __pyx_t_5, __pyx_v_BE, __pyx_v_assume_matrix, __pyx_v_solver_tol};
9008 __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_7, 4+__pyx_t_7);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1100, __pyx_L1_error)
9009 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
9010 __Pyx_GOTREF(__pyx_t_3);
9011 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
9015 __pyx_t_8 = PyTuple_New(4+__pyx_t_7);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1100, __pyx_L1_error)
9016 __Pyx_GOTREF(__pyx_t_8);
9018 __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6); __pyx_t_6 = NULL;
9020 __Pyx_GIVEREF(__pyx_t_5);
9021 PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_t_5);
9022 __Pyx_INCREF(__pyx_v_BE);
9023 __Pyx_GIVEREF(__pyx_v_BE);
9024 PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_v_BE);
9025 __Pyx_INCREF(__pyx_v_assume_matrix);
9026 __Pyx_GIVEREF(__pyx_v_assume_matrix);
9027 PyTuple_SET_ITEM(__pyx_t_8, 2+__pyx_t_7, __pyx_v_assume_matrix);
9028 __Pyx_INCREF(__pyx_v_solver_tol);
9029 __Pyx_GIVEREF(__pyx_v_solver_tol);
9030 PyTuple_SET_ITEM(__pyx_t_8, 3+__pyx_t_7, __pyx_v_solver_tol);
9032 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_8, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1100, __pyx_L1_error)
9033 __Pyx_GOTREF(__pyx_t_3);
9034 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
9036 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
9037 __pyx_v_OpE = __pyx_t_3;
9057 __Pyx_TraceLine(1102,0,__PYX_ERR(0, 1102, __pyx_L1_error))
9059 __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_linear_solver);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1102, __pyx_L1_error)
9060 __Pyx_GOTREF(__pyx_t_4);
9063 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
9064 __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_4);
9065 if (likely(__pyx_t_8)) {
9066 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_4);
9067 __Pyx_INCREF(__pyx_t_8);
9068 __Pyx_INCREF(
function);
9069 __Pyx_DECREF_SET(__pyx_t_4,
function);
9073 #if CYTHON_FAST_PYCALL
9074 if (PyFunction_Check(__pyx_t_4)) {
9075 PyObject *__pyx_temp[5] = {__pyx_t_8, __pyx_v_AtA, __pyx_v_BE, __pyx_v_assume_matrix, __pyx_v_solver_tol};
9076 __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_7, 4+__pyx_t_7);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1102, __pyx_L1_error)
9077 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
9078 __Pyx_GOTREF(__pyx_t_3);
9081 #if CYTHON_FAST_PYCCALL
9082 if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
9083 PyObject *__pyx_temp[5] = {__pyx_t_8, __pyx_v_AtA, __pyx_v_BE, __pyx_v_assume_matrix, __pyx_v_solver_tol};
9084 __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_7, 4+__pyx_t_7);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1102, __pyx_L1_error)
9085 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
9086 __Pyx_GOTREF(__pyx_t_3);
9090 __pyx_t_5 = PyTuple_New(4+__pyx_t_7);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1102, __pyx_L1_error)
9091 __Pyx_GOTREF(__pyx_t_5);
9093 __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_8); __pyx_t_8 = NULL;
9095 __Pyx_INCREF(__pyx_v_AtA);
9096 __Pyx_GIVEREF(__pyx_v_AtA);
9097 PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_7, __pyx_v_AtA);
9098 __Pyx_INCREF(__pyx_v_BE);
9099 __Pyx_GIVEREF(__pyx_v_BE);
9100 PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_7, __pyx_v_BE);
9101 __Pyx_INCREF(__pyx_v_assume_matrix);
9102 __Pyx_GIVEREF(__pyx_v_assume_matrix);
9103 PyTuple_SET_ITEM(__pyx_t_5, 2+__pyx_t_7, __pyx_v_assume_matrix);
9104 __Pyx_INCREF(__pyx_v_solver_tol);
9105 __Pyx_GIVEREF(__pyx_v_solver_tol);
9106 PyTuple_SET_ITEM(__pyx_t_5, 3+__pyx_t_7, __pyx_v_solver_tol);
9107 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1102, __pyx_L1_error)
9108 __Pyx_GOTREF(__pyx_t_3);
9109 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
9111 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
9112 __pyx_v_OpE = __pyx_t_3;
9134 __Pyx_TraceLine(1104,0,__PYX_ERR(0, 1104, __pyx_L1_error))
9136 __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_linear_solver);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1104, __pyx_L1_error)
9137 __Pyx_GOTREF(__pyx_t_4);
9140 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
9141 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
9142 if (likely(__pyx_t_5)) {
9143 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_4);
9144 __Pyx_INCREF(__pyx_t_5);
9145 __Pyx_INCREF(
function);
9146 __Pyx_DECREF_SET(__pyx_t_4,
function);
9150 #if CYTHON_FAST_PYCALL
9151 if (PyFunction_Check(__pyx_t_4)) {
9152 PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_v_A, __pyx_v_BE, __pyx_v_assume_matrix, __pyx_v_solver_tol};
9153 __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_7, 4+__pyx_t_7);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1104, __pyx_L1_error)
9154 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
9155 __Pyx_GOTREF(__pyx_t_3);
9158 #if CYTHON_FAST_PYCCALL
9159 if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
9160 PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_v_A, __pyx_v_BE, __pyx_v_assume_matrix, __pyx_v_solver_tol};
9161 __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_7, 4+__pyx_t_7);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1104, __pyx_L1_error)
9162 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
9163 __Pyx_GOTREF(__pyx_t_3);
9167 __pyx_t_8 = PyTuple_New(4+__pyx_t_7);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1104, __pyx_L1_error)
9168 __Pyx_GOTREF(__pyx_t_8);
9170 __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5); __pyx_t_5 = NULL;
9172 __Pyx_INCREF(__pyx_v_A);
9173 __Pyx_GIVEREF(__pyx_v_A);
9174 PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_v_A);
9175 __Pyx_INCREF(__pyx_v_BE);
9176 __Pyx_GIVEREF(__pyx_v_BE);
9177 PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_v_BE);
9178 __Pyx_INCREF(__pyx_v_assume_matrix);
9179 __Pyx_GIVEREF(__pyx_v_assume_matrix);
9180 PyTuple_SET_ITEM(__pyx_t_8, 2+__pyx_t_7, __pyx_v_assume_matrix);
9181 __Pyx_INCREF(__pyx_v_solver_tol);
9182 __Pyx_GIVEREF(__pyx_v_solver_tol);
9183 PyTuple_SET_ITEM(__pyx_t_8, 3+__pyx_t_7, __pyx_v_solver_tol);
9184 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_8, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1104, __pyx_L1_error)
9185 __Pyx_GOTREF(__pyx_t_3);
9186 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
9188 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
9189 __pyx_v_OpE = __pyx_t_3;
9211 __Pyx_TraceLine(1106,0,__PYX_ERR(0, 1106, __pyx_L1_error))
9212 __pyx_t_3 = PyObject_RichCompare(__pyx_v_p, __pyx_int_1, Py_GT); __Pyx_XGOTREF(__pyx_t_3);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1106, __pyx_L1_error)
9213 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3);
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 1106, __pyx_L1_error)
9214 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9224 __Pyx_TraceLine(1109,0,__PYX_ERR(0, 1109, __pyx_L1_error))
9225 __Pyx_INCREF(__pyx_v_BE);
9226 __pyx_v_OpE = __pyx_v_BE;
9235 __Pyx_TraceLine(1111,0,__PYX_ERR(0, 1111, __pyx_L1_error))
9236 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_gram);
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 1111, __pyx_L1_error)
9246 __Pyx_TraceLine(1112,0,__PYX_ERR(0, 1112, __pyx_L1_error))
9247 __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_v_p);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1112, __pyx_L1_error)
9248 __Pyx_GOTREF(__pyx_t_3);
9249 if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) {
9250 __pyx_t_4 = __pyx_t_3; __Pyx_INCREF(__pyx_t_4); __pyx_t_9 = 0;
9253 __pyx_t_9 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_3);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1112, __pyx_L1_error)
9254 __Pyx_GOTREF(__pyx_t_4);
9255 __pyx_t_10 = Py_TYPE(__pyx_t_4)->tp_iternext;
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1112, __pyx_L1_error)
9257 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9259 if (likely(!__pyx_t_10)) {
9260 if (likely(PyList_CheckExact(__pyx_t_4))) {
9261 if (__pyx_t_9 >= PyList_GET_SIZE(__pyx_t_4))
break;
9262 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
9263 __pyx_t_3 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_9); __Pyx_INCREF(__pyx_t_3); __pyx_t_9++;
if (unlikely(0 < 0)) __PYX_ERR(0, 1112, __pyx_L1_error)
9265 __pyx_t_3 = PySequence_ITEM(__pyx_t_4, __pyx_t_9); __pyx_t_9++;
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1112, __pyx_L1_error)
9266 __Pyx_GOTREF(__pyx_t_3);
9269 if (__pyx_t_9 >= PyTuple_GET_SIZE(__pyx_t_4))
break;
9270 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
9271 __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_9); __Pyx_INCREF(__pyx_t_3); __pyx_t_9++;
if (unlikely(0 < 0)) __PYX_ERR(0, 1112, __pyx_L1_error)
9273 __pyx_t_3 = PySequence_ITEM(__pyx_t_4, __pyx_t_9); __pyx_t_9++;
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1112, __pyx_L1_error)
9274 __Pyx_GOTREF(__pyx_t_3);
9278 __pyx_t_3 = __pyx_t_10(__pyx_t_4);
9279 if (unlikely(!__pyx_t_3)) {
9280 PyObject* exc_type = PyErr_Occurred();
9282 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
9283 else __PYX_ERR(0, 1112, __pyx_L1_error)
9287 __Pyx_GOTREF(__pyx_t_3);
9289 __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_3);
9299 __Pyx_TraceLine(1113,0,__PYX_ERR(0, 1113, __pyx_L1_error))
9300 __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_linear_solver);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1113, __pyx_L1_error)
9301 __Pyx_GOTREF(__pyx_t_8);
9304 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_8))) {
9305 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_8);
9306 if (likely(__pyx_t_5)) {
9307 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_8);
9308 __Pyx_INCREF(__pyx_t_5);
9309 __Pyx_INCREF(
function);
9310 __Pyx_DECREF_SET(__pyx_t_8,
function);
9314 #if CYTHON_FAST_PYCALL
9315 if (PyFunction_Check(__pyx_t_8)) {
9316 PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_v_AtA, __pyx_v_OpE, __pyx_v_assume_matrix, __pyx_v_solver_tol};
9317 __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_8, __pyx_temp+1-__pyx_t_7, 4+__pyx_t_7);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1113, __pyx_L1_error)
9318 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
9319 __Pyx_GOTREF(__pyx_t_3);
9322 #if CYTHON_FAST_PYCCALL
9323 if (__Pyx_PyFastCFunction_Check(__pyx_t_8)) {
9324 PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_v_AtA, __pyx_v_OpE, __pyx_v_assume_matrix, __pyx_v_solver_tol};
9325 __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_8, __pyx_temp+1-__pyx_t_7, 4+__pyx_t_7);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1113, __pyx_L1_error)
9326 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
9327 __Pyx_GOTREF(__pyx_t_3);
9331 __pyx_t_6 = PyTuple_New(4+__pyx_t_7);
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1113, __pyx_L1_error)
9332 __Pyx_GOTREF(__pyx_t_6);
9334 __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL;
9336 __Pyx_INCREF(__pyx_v_AtA);
9337 __Pyx_GIVEREF(__pyx_v_AtA);
9338 PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_7, __pyx_v_AtA);
9339 __Pyx_INCREF(__pyx_v_OpE);
9340 __Pyx_GIVEREF(__pyx_v_OpE);
9341 PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_7, __pyx_v_OpE);
9342 __Pyx_INCREF(__pyx_v_assume_matrix);
9343 __Pyx_GIVEREF(__pyx_v_assume_matrix);
9344 PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_7, __pyx_v_assume_matrix);
9345 __Pyx_INCREF(__pyx_v_solver_tol);
9346 __Pyx_GIVEREF(__pyx_v_solver_tol);
9347 PyTuple_SET_ITEM(__pyx_t_6, 3+__pyx_t_7, __pyx_v_solver_tol);
9348 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_6, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1113, __pyx_L1_error)
9349 __Pyx_GOTREF(__pyx_t_3);
9350 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
9352 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
9353 __Pyx_DECREF_SET(__pyx_v_OpE, __pyx_t_3);
9363 __Pyx_TraceLine(1112,0,__PYX_ERR(0, 1112, __pyx_L1_error))
9365 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
9384 __Pyx_TraceLine(1115,0,__PYX_ERR(0, 1115, __pyx_L1_error))
9386 __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_v_p);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1115, __pyx_L1_error)
9387 __Pyx_GOTREF(__pyx_t_4);
9388 if (likely(PyList_CheckExact(__pyx_t_4)) || PyTuple_CheckExact(__pyx_t_4)) {
9389 __pyx_t_3 = __pyx_t_4; __Pyx_INCREF(__pyx_t_3); __pyx_t_9 = 0;
9392 __pyx_t_9 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_4);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1115, __pyx_L1_error)
9393 __Pyx_GOTREF(__pyx_t_3);
9394 __pyx_t_10 = Py_TYPE(__pyx_t_3)->tp_iternext;
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1115, __pyx_L1_error)
9396 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
9398 if (likely(!__pyx_t_10)) {
9399 if (likely(PyList_CheckExact(__pyx_t_3))) {
9400 if (__pyx_t_9 >= PyList_GET_SIZE(__pyx_t_3))
break;
9401 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
9402 __pyx_t_4 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_9); __Pyx_INCREF(__pyx_t_4); __pyx_t_9++;
if (unlikely(0 < 0)) __PYX_ERR(0, 1115, __pyx_L1_error)
9404 __pyx_t_4 = PySequence_ITEM(__pyx_t_3, __pyx_t_9); __pyx_t_9++;
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1115, __pyx_L1_error)
9405 __Pyx_GOTREF(__pyx_t_4);
9408 if (__pyx_t_9 >= PyTuple_GET_SIZE(__pyx_t_3))
break;
9409 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
9410 __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_9); __Pyx_INCREF(__pyx_t_4); __pyx_t_9++;
if (unlikely(0 < 0)) __PYX_ERR(0, 1115, __pyx_L1_error)
9412 __pyx_t_4 = PySequence_ITEM(__pyx_t_3, __pyx_t_9); __pyx_t_9++;
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1115, __pyx_L1_error)
9413 __Pyx_GOTREF(__pyx_t_4);
9417 __pyx_t_4 = __pyx_t_10(__pyx_t_3);
9418 if (unlikely(!__pyx_t_4)) {
9419 PyObject* exc_type = PyErr_Occurred();
9421 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
9422 else __PYX_ERR(0, 1115, __pyx_L1_error)
9426 __Pyx_GOTREF(__pyx_t_4);
9428 __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_4);
9438 __Pyx_TraceLine(1116,0,__PYX_ERR(0, 1116, __pyx_L1_error))
9439 __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_linear_solver);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1116, __pyx_L1_error)
9440 __Pyx_GOTREF(__pyx_t_8);
9443 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_8))) {
9444 __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_8);
9445 if (likely(__pyx_t_6)) {
9446 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_8);
9447 __Pyx_INCREF(__pyx_t_6);
9448 __Pyx_INCREF(
function);
9449 __Pyx_DECREF_SET(__pyx_t_8,
function);
9453 #if CYTHON_FAST_PYCALL
9454 if (PyFunction_Check(__pyx_t_8)) {
9455 PyObject *__pyx_temp[5] = {__pyx_t_6, __pyx_v_A, __pyx_v_OpE, __pyx_v_assume_matrix, __pyx_v_solver_tol};
9456 __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_8, __pyx_temp+1-__pyx_t_7, 4+__pyx_t_7);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1116, __pyx_L1_error)
9457 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
9458 __Pyx_GOTREF(__pyx_t_4);
9461 #if CYTHON_FAST_PYCCALL
9462 if (__Pyx_PyFastCFunction_Check(__pyx_t_8)) {
9463 PyObject *__pyx_temp[5] = {__pyx_t_6, __pyx_v_A, __pyx_v_OpE, __pyx_v_assume_matrix, __pyx_v_solver_tol};
9464 __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_8, __pyx_temp+1-__pyx_t_7, 4+__pyx_t_7);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1116, __pyx_L1_error)
9465 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
9466 __Pyx_GOTREF(__pyx_t_4);
9470 __pyx_t_5 = PyTuple_New(4+__pyx_t_7);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1116, __pyx_L1_error)
9471 __Pyx_GOTREF(__pyx_t_5);
9473 __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_6); __pyx_t_6 = NULL;
9475 __Pyx_INCREF(__pyx_v_A);
9476 __Pyx_GIVEREF(__pyx_v_A);
9477 PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_7, __pyx_v_A);
9478 __Pyx_INCREF(__pyx_v_OpE);
9479 __Pyx_GIVEREF(__pyx_v_OpE);
9480 PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_7, __pyx_v_OpE);
9481 __Pyx_INCREF(__pyx_v_assume_matrix);
9482 __Pyx_GIVEREF(__pyx_v_assume_matrix);
9483 PyTuple_SET_ITEM(__pyx_t_5, 2+__pyx_t_7, __pyx_v_assume_matrix);
9484 __Pyx_INCREF(__pyx_v_solver_tol);
9485 __Pyx_GIVEREF(__pyx_v_solver_tol);
9486 PyTuple_SET_ITEM(__pyx_t_5, 3+__pyx_t_7, __pyx_v_solver_tol);
9487 __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_5, NULL);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1116, __pyx_L1_error)
9488 __Pyx_GOTREF(__pyx_t_4);
9489 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
9491 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
9492 __Pyx_DECREF_SET(__pyx_v_OpE, __pyx_t_4);
9502 __Pyx_TraceLine(1115,0,__PYX_ERR(0, 1115, __pyx_L1_error))
9504 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9525 __Pyx_TraceLine(1118,0,__PYX_ERR(0, 1118, __pyx_L1_error))
9526 __pyx_t_3 = __Pyx_PyInt_EqObjC(__pyx_v_p, __pyx_int_neg_1, -1L, 0);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1118, __pyx_L1_error)
9527 __Pyx_GOTREF(__pyx_t_3);
9528 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3);
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 1118, __pyx_L1_error)
9529 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9539 __Pyx_TraceLine(1120,0,__PYX_ERR(0, 1120, __pyx_L1_error))
9540 __pyx_t_3 = __Pyx_PyNumber_MatrixMultiply(__pyx_v_A, __pyx_v_BE);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1120, __pyx_L1_error)
9541 __Pyx_GOTREF(__pyx_t_3);
9542 __pyx_v_OpE = __pyx_t_3;
9562 __Pyx_TraceLine(1122,0,__PYX_ERR(0, 1122, __pyx_L1_error))
9563 __pyx_t_3 = PyObject_RichCompare(__pyx_v_p, __pyx_int_neg_1, Py_LT); __Pyx_XGOTREF(__pyx_t_3);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1122, __pyx_L1_error)
9564 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3);
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 1122, __pyx_L1_error)
9565 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9575 __Pyx_TraceLine(1124,0,__PYX_ERR(0, 1124, __pyx_L1_error))
9576 __Pyx_INCREF(__pyx_v_BE);
9577 __pyx_v_AinvpE = __pyx_v_BE;
9586 __Pyx_TraceLine(1125,0,__PYX_ERR(0, 1125, __pyx_L1_error))
9587 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_gram);
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 1125, __pyx_L1_error)
9597 __Pyx_TraceLine(1126,0,__PYX_ERR(0, 1126, __pyx_L1_error))
9598 __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_numpy);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1126, __pyx_L1_error)
9599 __Pyx_GOTREF(__pyx_t_4);
9600 __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_abs);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1126, __pyx_L1_error)
9601 __Pyx_GOTREF(__pyx_t_8);
9602 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
9604 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_8))) {
9605 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_8);
9606 if (likely(__pyx_t_4)) {
9607 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_8);
9608 __Pyx_INCREF(__pyx_t_4);
9609 __Pyx_INCREF(
function);
9610 __Pyx_DECREF_SET(__pyx_t_8,
function);
9613 __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_4, __pyx_v_p) : __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_v_p);
9614 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
9615 if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1126, __pyx_L1_error)
9616 __Pyx_GOTREF(__pyx_t_3);
9617 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
9618 __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_t_3);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1126, __pyx_L1_error)
9619 __Pyx_GOTREF(__pyx_t_8);
9620 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9621 if (likely(PyList_CheckExact(__pyx_t_8)) || PyTuple_CheckExact(__pyx_t_8)) {
9622 __pyx_t_3 = __pyx_t_8; __Pyx_INCREF(__pyx_t_3); __pyx_t_9 = 0;
9625 __pyx_t_9 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_8);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1126, __pyx_L1_error)
9626 __Pyx_GOTREF(__pyx_t_3);
9627 __pyx_t_10 = Py_TYPE(__pyx_t_3)->tp_iternext;
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1126, __pyx_L1_error)
9629 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
9631 if (likely(!__pyx_t_10)) {
9632 if (likely(PyList_CheckExact(__pyx_t_3))) {
9633 if (__pyx_t_9 >= PyList_GET_SIZE(__pyx_t_3))
break;
9634 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
9635 __pyx_t_8 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_9); __Pyx_INCREF(__pyx_t_8); __pyx_t_9++;
if (unlikely(0 < 0)) __PYX_ERR(0, 1126, __pyx_L1_error)
9637 __pyx_t_8 = PySequence_ITEM(__pyx_t_3, __pyx_t_9); __pyx_t_9++;
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1126, __pyx_L1_error)
9638 __Pyx_GOTREF(__pyx_t_8);
9641 if (__pyx_t_9 >= PyTuple_GET_SIZE(__pyx_t_3))
break;
9642 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
9643 __pyx_t_8 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_9); __Pyx_INCREF(__pyx_t_8); __pyx_t_9++;
if (unlikely(0 < 0)) __PYX_ERR(0, 1126, __pyx_L1_error)
9645 __pyx_t_8 = PySequence_ITEM(__pyx_t_3, __pyx_t_9); __pyx_t_9++;
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1126, __pyx_L1_error)
9646 __Pyx_GOTREF(__pyx_t_8);
9650 __pyx_t_8 = __pyx_t_10(__pyx_t_3);
9651 if (unlikely(!__pyx_t_8)) {
9652 PyObject* exc_type = PyErr_Occurred();
9654 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
9655 else __PYX_ERR(0, 1126, __pyx_L1_error)
9659 __Pyx_GOTREF(__pyx_t_8);
9661 __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_8);
9671 __Pyx_TraceLine(1127,0,__PYX_ERR(0, 1127, __pyx_L1_error))
9672 if (unlikely(!__pyx_v_OpE)) { __Pyx_RaiseUnboundLocalError(
"OpE"); __PYX_ERR(0, 1127, __pyx_L1_error) }
9673 __pyx_t_8 = __Pyx_PyNumber_MatrixMultiply(__pyx_v_AtA, __pyx_v_OpE);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1127, __pyx_L1_error)
9674 __Pyx_GOTREF(__pyx_t_8);
9675 __Pyx_XDECREF_SET(__pyx_v_OpE, __pyx_t_8);
9685 __Pyx_TraceLine(1126,0,__PYX_ERR(0, 1126, __pyx_L1_error))
9687 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9706 __Pyx_TraceLine(1129,0,__PYX_ERR(0, 1129, __pyx_L1_error))
9708 __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_numpy);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1129, __pyx_L1_error)
9709 __Pyx_GOTREF(__pyx_t_8);
9710 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_abs);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1129, __pyx_L1_error)
9711 __Pyx_GOTREF(__pyx_t_4);
9712 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
9714 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
9715 __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_4);
9716 if (likely(__pyx_t_8)) {
9717 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_4);
9718 __Pyx_INCREF(__pyx_t_8);
9719 __Pyx_INCREF(
function);
9720 __Pyx_DECREF_SET(__pyx_t_4,
function);
9723 __pyx_t_3 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_8, __pyx_v_p) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_p);
9724 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
9725 if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1129, __pyx_L1_error)
9726 __Pyx_GOTREF(__pyx_t_3);
9727 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
9728 __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_t_3);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1129, __pyx_L1_error)
9729 __Pyx_GOTREF(__pyx_t_4);
9730 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9731 if (likely(PyList_CheckExact(__pyx_t_4)) || PyTuple_CheckExact(__pyx_t_4)) {
9732 __pyx_t_3 = __pyx_t_4; __Pyx_INCREF(__pyx_t_3); __pyx_t_9 = 0;
9735 __pyx_t_9 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_4);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1129, __pyx_L1_error)
9736 __Pyx_GOTREF(__pyx_t_3);
9737 __pyx_t_10 = Py_TYPE(__pyx_t_3)->tp_iternext;
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1129, __pyx_L1_error)
9739 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
9741 if (likely(!__pyx_t_10)) {
9742 if (likely(PyList_CheckExact(__pyx_t_3))) {
9743 if (__pyx_t_9 >= PyList_GET_SIZE(__pyx_t_3))
break;
9744 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
9745 __pyx_t_4 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_9); __Pyx_INCREF(__pyx_t_4); __pyx_t_9++;
if (unlikely(0 < 0)) __PYX_ERR(0, 1129, __pyx_L1_error)
9747 __pyx_t_4 = PySequence_ITEM(__pyx_t_3, __pyx_t_9); __pyx_t_9++;
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1129, __pyx_L1_error)
9748 __Pyx_GOTREF(__pyx_t_4);
9751 if (__pyx_t_9 >= PyTuple_GET_SIZE(__pyx_t_3))
break;
9752 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
9753 __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_9); __Pyx_INCREF(__pyx_t_4); __pyx_t_9++;
if (unlikely(0 < 0)) __PYX_ERR(0, 1129, __pyx_L1_error)
9755 __pyx_t_4 = PySequence_ITEM(__pyx_t_3, __pyx_t_9); __pyx_t_9++;
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1129, __pyx_L1_error)
9756 __Pyx_GOTREF(__pyx_t_4);
9760 __pyx_t_4 = __pyx_t_10(__pyx_t_3);
9761 if (unlikely(!__pyx_t_4)) {
9762 PyObject* exc_type = PyErr_Occurred();
9764 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
9765 else __PYX_ERR(0, 1129, __pyx_L1_error)
9769 __Pyx_GOTREF(__pyx_t_4);
9771 __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_4);
9781 __Pyx_TraceLine(1130,0,__PYX_ERR(0, 1130, __pyx_L1_error))
9782 if (unlikely(!__pyx_v_OpE)) { __Pyx_RaiseUnboundLocalError(
"OpE"); __PYX_ERR(0, 1130, __pyx_L1_error) }
9783 __pyx_t_4 = __Pyx_PyNumber_MatrixMultiply(__pyx_v_A, __pyx_v_OpE);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1130, __pyx_L1_error)
9784 __Pyx_GOTREF(__pyx_t_4);
9785 __Pyx_XDECREF_SET(__pyx_v_OpE, __pyx_t_4);
9795 __Pyx_TraceLine(1129,0,__PYX_ERR(0, 1129, __pyx_L1_error))
9797 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9816 __Pyx_TraceLine(1132,0,__PYX_ERR(0, 1132, __pyx_L1_error))
9817 __Pyx_XDECREF(__pyx_r);
9818 if (unlikely(!__pyx_v_OpE)) { __Pyx_RaiseUnboundLocalError(
"OpE"); __PYX_ERR(0, 1132, __pyx_L1_error) }
9819 __Pyx_INCREF(__pyx_v_OpE);
9820 __pyx_r = __pyx_v_OpE;
9833 __Pyx_XDECREF(__pyx_t_3);
9834 __Pyx_XDECREF(__pyx_t_4);
9835 __Pyx_XDECREF(__pyx_t_5);
9836 __Pyx_XDECREF(__pyx_t_6);
9837 __Pyx_XDECREF(__pyx_t_8);
9838 __Pyx_AddTraceback(
"imate.traceinv._hutchinson_method._operator_dot", __pyx_clineno, __pyx_lineno, __pyx_filename);
9841 __Pyx_XDECREF(__pyx_v_BE);
9842 __Pyx_XDECREF(__pyx_v_OpE);
9843 __Pyx_XDECREF(__pyx_v_i);
9844 __Pyx_XDECREF(__pyx_v_AinvpE);
9845 __Pyx_XGIVEREF(__pyx_r);
9846 __Pyx_TraceReturn(__pyx_r, 0);
9847 __Pyx_RefNannyFinishContext();
9860 static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
9861 static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
9862 PyObject *__pyx_v_shape = 0;
9863 Py_ssize_t __pyx_v_itemsize;
9864 PyObject *__pyx_v_format = 0;
9865 PyObject *__pyx_v_mode = 0;
9866 int __pyx_v_allocate_buffer;
9867 int __pyx_lineno = 0;
9868 const char *__pyx_filename = NULL;
9869 int __pyx_clineno = 0;
9871 __Pyx_RefNannyDeclarations
9872 __Pyx_RefNannySetupContext(
"__cinit__ (wrapper)", 0);
9874 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_shape,&__pyx_n_s_itemsize,&__pyx_n_s_format,&__pyx_n_s_mode,&__pyx_n_s_allocate_buffer,0};
9875 PyObject* values[5] = {0,0,0,0,0};
9876 values[3] = ((PyObject *)__pyx_n_s_c);
9877 if (unlikely(__pyx_kwds)) {
9879 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
9881 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
9883 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
9885 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
9887 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
9889 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
9892 default:
goto __pyx_L5_argtuple_error;
9894 kw_args = PyDict_Size(__pyx_kwds);
9897 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_shape)) != 0)) kw_args--;
9898 else goto __pyx_L5_argtuple_error;
9901 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_itemsize)) != 0)) kw_args--;
9903 __Pyx_RaiseArgtupleInvalid(
"__cinit__", 0, 3, 5, 1); __PYX_ERR(1, 123, __pyx_L3_error)
9907 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_format)) != 0)) kw_args--;
9909 __Pyx_RaiseArgtupleInvalid(
"__cinit__", 0, 3, 5, 2); __PYX_ERR(1, 123, __pyx_L3_error)
9914 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mode);
9915 if (value) { values[3] = value; kw_args--; }
9920 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_allocate_buffer);
9921 if (value) { values[4] = value; kw_args--; }
9924 if (unlikely(kw_args > 0)) {
9925 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"__cinit__") < 0)) __PYX_ERR(1, 123, __pyx_L3_error)
9928 switch (PyTuple_GET_SIZE(__pyx_args)) {
9929 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
9931 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
9933 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
9934 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
9935 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
9937 default:
goto __pyx_L5_argtuple_error;
9940 __pyx_v_shape = ((PyObject*)values[0]);
9941 __pyx_v_itemsize = __Pyx_PyIndex_AsSsize_t(values[1]);
if (unlikely((__pyx_v_itemsize == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 123, __pyx_L3_error)
9942 __pyx_v_format = values[2];
9943 __pyx_v_mode = values[3];
9945 __pyx_v_allocate_buffer = __Pyx_PyObject_IsTrue(values[4]);
if (unlikely((__pyx_v_allocate_buffer == (
int)-1) && PyErr_Occurred())) __PYX_ERR(1, 124, __pyx_L3_error)
9955 __pyx_v_allocate_buffer = ((int)1);
9958 goto __pyx_L4_argument_unpacking_done;
9959 __pyx_L5_argtuple_error:;
9960 __Pyx_RaiseArgtupleInvalid(
"__cinit__", 0, 3, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 123, __pyx_L3_error)
9962 __Pyx_AddTraceback(
"View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9963 __Pyx_RefNannyFinishContext();
9965 __pyx_L4_argument_unpacking_done:;
9966 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_shape), (&PyTuple_Type), 1,
"shape", 1))) __PYX_ERR(1, 123, __pyx_L1_error)
9967 if (unlikely(((PyObject *)__pyx_v_format) == Py_None)) {
9968 PyErr_Format(PyExc_TypeError,
"Argument '%.200s' must not be None",
"format"); __PYX_ERR(1, 123, __pyx_L1_error)
9970 __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(((
struct __pyx_array_obj *)__pyx_v_self), __pyx_v_shape, __pyx_v_itemsize, __pyx_v_format, __pyx_v_mode, __pyx_v_allocate_buffer);
9985 __Pyx_RefNannyFinishContext();
9989 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(
struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, PyObject *__pyx_v_format, PyObject *__pyx_v_mode,
int __pyx_v_allocate_buffer) {
9991 Py_ssize_t __pyx_v_i;
9992 Py_ssize_t __pyx_v_dim;
9993 PyObject **__pyx_v_p;
9996 __Pyx_TraceDeclarations
9997 __Pyx_RefNannyDeclarations
9998 Py_ssize_t __pyx_t_1;
10000 PyObject *__pyx_t_3 = NULL;
10002 PyObject *__pyx_t_5 = NULL;
10003 PyObject *__pyx_t_6 = NULL;
10006 Py_ssize_t __pyx_t_9;
10007 PyObject *__pyx_t_10 = NULL;
10008 Py_ssize_t __pyx_t_11;
10009 int __pyx_lineno = 0;
10010 const char *__pyx_filename = NULL;
10011 int __pyx_clineno = 0;
10012 __Pyx_RefNannySetupContext(
"__cinit__", 0);
10013 __Pyx_TraceCall(
"__cinit__", __pyx_f[1], 123, 0, __PYX_ERR(1, 123, __pyx_L1_error));
10014 __Pyx_INCREF(__pyx_v_format);
10023 __Pyx_TraceLine(130,0,__PYX_ERR(1, 130, __pyx_L1_error))
10024 if (unlikely(__pyx_v_shape == Py_None)) {
10025 PyErr_SetString(PyExc_TypeError,
"object of type 'NoneType' has no len()");
10026 __PYX_ERR(1, 130, __pyx_L1_error)
10028 __pyx_t_1 = PyTuple_GET_SIZE(__pyx_v_shape);
if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(1, 130, __pyx_L1_error)
10029 __pyx_v_self->ndim = ((int)__pyx_t_1);
10038 __Pyx_TraceLine(131,0,__PYX_ERR(1, 131, __pyx_L1_error))
10039 __pyx_v_self->itemsize = __pyx_v_itemsize;
10048 __Pyx_TraceLine(133,0,__PYX_ERR(1, 133, __pyx_L1_error))
10049 __pyx_t_2 = ((!(__pyx_v_self->ndim != 0)) != 0);
10050 if (unlikely(__pyx_t_2)) {
10059 __Pyx_TraceLine(134,0,__PYX_ERR(1, 134, __pyx_L1_error))
10060 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__8, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 134, __pyx_L1_error)
10061 __Pyx_GOTREF(__pyx_t_3);
10062 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
10063 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10064 __PYX_ERR(1, 134, __pyx_L1_error)
10082 __Pyx_TraceLine(136,0,__PYX_ERR(1, 136, __pyx_L1_error))
10083 __pyx_t_2 = ((__pyx_v_itemsize <= 0) != 0);
10084 if (unlikely(__pyx_t_2)) {
10093 __Pyx_TraceLine(137,0,__PYX_ERR(1, 137, __pyx_L1_error))
10094 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__9, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 137, __pyx_L1_error)
10095 __Pyx_GOTREF(__pyx_t_3);
10096 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
10097 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10098 __PYX_ERR(1, 137, __pyx_L1_error)
10116 __Pyx_TraceLine(139,0,__PYX_ERR(1, 139, __pyx_L1_error))
10117 __pyx_t_2 = PyBytes_Check(__pyx_v_format);
10118 __pyx_t_4 = ((!(__pyx_t_2 != 0)) != 0);
10128 __Pyx_TraceLine(140,0,__PYX_ERR(1, 140, __pyx_L1_error))
10129 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_format, __pyx_n_s_encode);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 140, __pyx_L1_error)
10130 __Pyx_GOTREF(__pyx_t_5);
10132 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
10133 __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
10134 if (likely(__pyx_t_6)) {
10135 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_5);
10136 __Pyx_INCREF(__pyx_t_6);
10137 __Pyx_INCREF(
function);
10138 __Pyx_DECREF_SET(__pyx_t_5,
function);
10141 __pyx_t_3 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_n_s_ASCII) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_n_s_ASCII);
10142 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
10143 if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 140, __pyx_L1_error)
10144 __Pyx_GOTREF(__pyx_t_3);
10145 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
10146 __Pyx_DECREF_SET(__pyx_v_format, __pyx_t_3);
10165 __Pyx_TraceLine(141,0,__PYX_ERR(1, 141, __pyx_L1_error))
10166 if (!(likely(PyBytes_CheckExact(__pyx_v_format))||((__pyx_v_format) == Py_None)||((
void)PyErr_Format(PyExc_TypeError,
"Expected %.16s, got %.200s",
"bytes", Py_TYPE(__pyx_v_format)->tp_name), 0))) __PYX_ERR(1, 141, __pyx_L1_error)
10167 __pyx_t_3 = __pyx_v_format;
10168 __Pyx_INCREF(__pyx_t_3);
10169 __Pyx_GIVEREF(__pyx_t_3);
10170 __Pyx_GOTREF(__pyx_v_self->_format);
10171 __Pyx_DECREF(__pyx_v_self->_format);
10172 __pyx_v_self->_format = ((PyObject*)__pyx_t_3);
10182 __Pyx_TraceLine(142,0,__PYX_ERR(1, 142, __pyx_L1_error))
10183 if (unlikely(__pyx_v_self->_format == Py_None)) {
10184 PyErr_SetString(PyExc_TypeError,
"expected bytes, NoneType found");
10185 __PYX_ERR(1, 142, __pyx_L1_error)
10187 __pyx_t_7 = __Pyx_PyBytes_AsWritableString(__pyx_v_self->_format);
if (unlikely((!__pyx_t_7) && PyErr_Occurred())) __PYX_ERR(1, 142, __pyx_L1_error)
10188 __pyx_v_self->format = __pyx_t_7;
10197 __Pyx_TraceLine(145,0,__PYX_ERR(1, 145, __pyx_L1_error))
10198 __pyx_v_self->_shape = ((Py_ssize_t *)PyObject_Malloc((((
sizeof(Py_ssize_t)) * __pyx_v_self->ndim) * 2)));
10207 __Pyx_TraceLine(146,0,__PYX_ERR(1, 146, __pyx_L1_error))
10208 __pyx_v_self->_strides = (__pyx_v_self->_shape + __pyx_v_self->ndim);
10217 __Pyx_TraceLine(148,0,__PYX_ERR(1, 148, __pyx_L1_error))
10218 __pyx_t_4 = ((!(__pyx_v_self->_shape != 0)) != 0);
10219 if (unlikely(__pyx_t_4)) {
10228 __Pyx_TraceLine(149,0,__PYX_ERR(1, 149, __pyx_L1_error))
10229 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__10, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 149, __pyx_L1_error)
10230 __Pyx_GOTREF(__pyx_t_3);
10231 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
10232 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10233 __PYX_ERR(1, 149, __pyx_L1_error)
10251 __Pyx_TraceLine(152,0,__PYX_ERR(1, 152, __pyx_L1_error))
10253 __pyx_t_3 = __pyx_v_shape; __Pyx_INCREF(__pyx_t_3); __pyx_t_1 = 0;
10255 if (__pyx_t_1 >= PyTuple_GET_SIZE(__pyx_t_3))
break;
10256 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
10257 __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_1); __Pyx_INCREF(__pyx_t_5); __pyx_t_1++;
if (unlikely(0 < 0)) __PYX_ERR(1, 152, __pyx_L1_error)
10259 __pyx_t_5 = PySequence_ITEM(__pyx_t_3, __pyx_t_1); __pyx_t_1++;
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 152, __pyx_L1_error)
10260 __Pyx_GOTREF(__pyx_t_5);
10262 __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_5);
if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 152, __pyx_L1_error)
10263 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
10264 __pyx_v_dim = __pyx_t_9;
10265 __pyx_v_idx = __pyx_t_8;
10266 __pyx_t_8 = (__pyx_t_8 + 1);
10275 __Pyx_TraceLine(153,0,__PYX_ERR(1, 153, __pyx_L1_error))
10276 __pyx_t_4 = ((__pyx_v_dim <= 0) != 0);
10277 if (unlikely(__pyx_t_4)) {
10286 __Pyx_TraceLine(154,0,__PYX_ERR(1, 154, __pyx_L1_error))
10287 __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_idx);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 154, __pyx_L1_error)
10288 __Pyx_GOTREF(__pyx_t_5);
10289 __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_dim);
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 154, __pyx_L1_error)
10290 __Pyx_GOTREF(__pyx_t_6);
10291 __pyx_t_10 = PyTuple_New(2);
if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 154, __pyx_L1_error)
10292 __Pyx_GOTREF(__pyx_t_10);
10293 __Pyx_GIVEREF(__pyx_t_5);
10294 PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_5);
10295 __Pyx_GIVEREF(__pyx_t_6);
10296 PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_6);
10299 __pyx_t_6 = __Pyx_PyString_Format(__pyx_kp_s_Invalid_shape_in_axis_d_d, __pyx_t_10);
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 154, __pyx_L1_error)
10300 __Pyx_GOTREF(__pyx_t_6);
10301 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
10302 __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_6);
if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 154, __pyx_L1_error)
10303 __Pyx_GOTREF(__pyx_t_10);
10304 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
10305 __Pyx_Raise(__pyx_t_10, 0, 0, 0);
10306 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
10307 __PYX_ERR(1, 154, __pyx_L1_error)
10325 __Pyx_TraceLine(155,0,__PYX_ERR(1, 155, __pyx_L1_error))
10326 (__pyx_v_self->_shape[__pyx_v_idx]) = __pyx_v_dim;
10335 __Pyx_TraceLine(152,0,__PYX_ERR(1, 152, __pyx_L1_error))
10337 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10346 __Pyx_TraceLine(158,0,__PYX_ERR(1, 158, __pyx_L1_error))
10347 __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_fortran, Py_EQ));
if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(1, 158, __pyx_L1_error)
10357 __Pyx_TraceLine(159,0,__PYX_ERR(1, 159, __pyx_L1_error))
10358 __pyx_v_order =
'F';
10367 __Pyx_TraceLine(160,0,__PYX_ERR(1, 160, __pyx_L1_error))
10368 __Pyx_INCREF(__pyx_n_u_fortran);
10369 __Pyx_GIVEREF(__pyx_n_u_fortran);
10370 __Pyx_GOTREF(__pyx_v_self->mode);
10371 __Pyx_DECREF(__pyx_v_self->mode);
10372 __pyx_v_self->mode = __pyx_n_u_fortran;
10391 __Pyx_TraceLine(161,0,__PYX_ERR(1, 161, __pyx_L1_error))
10392 __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_c, Py_EQ));
if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(1, 161, __pyx_L1_error)
10393 if (likely(__pyx_t_4)) {
10402 __Pyx_TraceLine(162,0,__PYX_ERR(1, 162, __pyx_L1_error))
10403 __pyx_v_order =
'C';
10412 __Pyx_TraceLine(163,0,__PYX_ERR(1, 163, __pyx_L1_error))
10413 __Pyx_INCREF(__pyx_n_u_c);
10414 __Pyx_GIVEREF(__pyx_n_u_c);
10415 __Pyx_GOTREF(__pyx_v_self->mode);
10416 __Pyx_DECREF(__pyx_v_self->mode);
10417 __pyx_v_self->mode = __pyx_n_u_c;
10436 __Pyx_TraceLine(165,0,__PYX_ERR(1, 165, __pyx_L1_error))
10438 __pyx_t_3 = __Pyx_PyString_FormatSafe(__pyx_kp_s_Invalid_mode_expected_c_or_fortr, __pyx_v_mode);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 165, __pyx_L1_error)
10439 __Pyx_GOTREF(__pyx_t_3);
10440 __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3);
if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 165, __pyx_L1_error)
10441 __Pyx_GOTREF(__pyx_t_10);
10442 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10443 __Pyx_Raise(__pyx_t_10, 0, 0, 0);
10444 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
10445 __PYX_ERR(1, 165, __pyx_L1_error)
10456 __Pyx_TraceLine(167,0,__PYX_ERR(1, 167, __pyx_L1_error))
10457 __pyx_v_self->len = __pyx_fill_contig_strides_array(__pyx_v_self->_shape, __pyx_v_self->_strides, __pyx_v_itemsize, __pyx_v_self->ndim, __pyx_v_order);
10466 __Pyx_TraceLine(170,0,__PYX_ERR(1, 170, __pyx_L1_error))
10467 __pyx_v_self->free_data = __pyx_v_allocate_buffer;
10476 __Pyx_TraceLine(171,0,__PYX_ERR(1, 171, __pyx_L1_error))
10477 __pyx_t_10 = PyObject_RichCompare(__pyx_v_format, __pyx_n_b_O, Py_EQ); __Pyx_XGOTREF(__pyx_t_10);
if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 171, __pyx_L1_error)
10478 __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_10);
if (unlikely((__pyx_t_4 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(1, 171, __pyx_L1_error)
10479 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
10480 __pyx_v_self->dtype_is_object = __pyx_t_4;
10489 __Pyx_TraceLine(172,0,__PYX_ERR(1, 172, __pyx_L1_error))
10490 __pyx_t_4 = (__pyx_v_allocate_buffer != 0);
10500 __Pyx_TraceLine(175,0,__PYX_ERR(1, 175, __pyx_L1_error))
10501 __pyx_v_self->data = ((
char *)malloc(__pyx_v_self->len));
10510 __Pyx_TraceLine(176,0,__PYX_ERR(1, 176, __pyx_L1_error))
10511 __pyx_t_4 = ((!(__pyx_v_self->data != 0)) != 0);
10512 if (unlikely(__pyx_t_4)) {
10521 __Pyx_TraceLine(177,0,__PYX_ERR(1, 177, __pyx_L1_error))
10522 __pyx_t_10 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__11, NULL);
if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 177, __pyx_L1_error)
10523 __Pyx_GOTREF(__pyx_t_10);
10524 __Pyx_Raise(__pyx_t_10, 0, 0, 0);
10525 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
10526 __PYX_ERR(1, 177, __pyx_L1_error)
10544 __Pyx_TraceLine(179,0,__PYX_ERR(1, 179, __pyx_L1_error))
10545 __pyx_t_4 = (__pyx_v_self->dtype_is_object != 0);
10555 __Pyx_TraceLine(180,0,__PYX_ERR(1, 180, __pyx_L1_error))
10556 __pyx_v_p = ((PyObject **)__pyx_v_self->data);
10565 __Pyx_TraceLine(181,0,__PYX_ERR(1, 181, __pyx_L1_error))
10566 if (unlikely(__pyx_v_itemsize == 0)) {
10567 PyErr_SetString(PyExc_ZeroDivisionError,
"integer division or modulo by zero");
10568 __PYX_ERR(1, 181, __pyx_L1_error)
10570 else if (
sizeof(Py_ssize_t) ==
sizeof(
long) && (!(((Py_ssize_t)-1) > 0)) && unlikely(__pyx_v_itemsize == (Py_ssize_t)-1) && unlikely(UNARY_NEG_WOULD_OVERFLOW(__pyx_v_self->len))) {
10571 PyErr_SetString(PyExc_OverflowError,
"value too large to perform division");
10572 __PYX_ERR(1, 181, __pyx_L1_error)
10574 __pyx_t_1 = (__pyx_v_self->len / __pyx_v_itemsize);
10575 __pyx_t_9 = __pyx_t_1;
10576 for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_9; __pyx_t_11+=1) {
10577 __pyx_v_i = __pyx_t_11;
10586 __Pyx_TraceLine(182,0,__PYX_ERR(1, 182, __pyx_L1_error))
10587 (__pyx_v_p[__pyx_v_i]) = Py_None;
10596 __Pyx_TraceLine(183,0,__PYX_ERR(1, 183, __pyx_L1_error))
10597 Py_INCREF(Py_None);
10630 __Pyx_XDECREF(__pyx_t_3);
10631 __Pyx_XDECREF(__pyx_t_5);
10632 __Pyx_XDECREF(__pyx_t_6);
10633 __Pyx_XDECREF(__pyx_t_10);
10634 __Pyx_AddTraceback(
"View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10637 __Pyx_XDECREF(__pyx_v_format);
10638 __Pyx_TraceReturn(Py_None, 0);
10639 __Pyx_RefNannyFinishContext();
10652 static CYTHON_UNUSED
int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags);
10653 static CYTHON_UNUSED
int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags) {
10655 __Pyx_RefNannyDeclarations
10656 __Pyx_RefNannySetupContext(
"__getbuffer__ (wrapper)", 0);
10657 __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(((
struct __pyx_array_obj *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((
int)__pyx_v_flags));
10660 __Pyx_RefNannyFinishContext();
10664 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(
struct __pyx_array_obj *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags) {
10665 int __pyx_v_bufmode;
10667 __Pyx_TraceDeclarations
10668 __Pyx_RefNannyDeclarations
10671 PyObject *__pyx_t_3 = NULL;
10673 Py_ssize_t __pyx_t_5;
10675 Py_ssize_t *__pyx_t_7;
10676 int __pyx_lineno = 0;
10677 const char *__pyx_filename = NULL;
10678 int __pyx_clineno = 0;
10679 if (__pyx_v_info == NULL) {
10680 PyErr_SetString(PyExc_BufferError,
"PyObject_GetBuffer: view==NULL argument is obsolete");
10683 __Pyx_RefNannySetupContext(
"__getbuffer__", 0);
10684 __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
10685 __Pyx_GIVEREF(__pyx_v_info->obj);
10686 __Pyx_TraceCall(
"__getbuffer__", __pyx_f[1], 186, 0, __PYX_ERR(1, 186, __pyx_L1_error));
10695 __Pyx_TraceLine(187,0,__PYX_ERR(1, 187, __pyx_L1_error))
10696 __pyx_v_bufmode = -1;
10705 __Pyx_TraceLine(188,0,__PYX_ERR(1, 188, __pyx_L1_error))
10706 __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_c, Py_EQ));
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 188, __pyx_L1_error)
10707 __pyx_t_2 = (__pyx_t_1 != 0);
10717 __Pyx_TraceLine(189,0,__PYX_ERR(1, 189, __pyx_L1_error))
10718 __pyx_v_bufmode = (PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS);
10737 __Pyx_TraceLine(190,0,__PYX_ERR(1, 190, __pyx_L1_error))
10738 __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_fortran, Py_EQ));
if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(1, 190, __pyx_L1_error)
10739 __pyx_t_1 = (__pyx_t_2 != 0);
10749 __Pyx_TraceLine(191,0,__PYX_ERR(1, 191, __pyx_L1_error))
10750 __pyx_v_bufmode = (PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS);
10769 __Pyx_TraceLine(192,0,__PYX_ERR(1, 192, __pyx_L1_error))
10770 __pyx_t_1 = ((!((__pyx_v_flags & __pyx_v_bufmode) != 0)) != 0);
10771 if (unlikely(__pyx_t_1)) {
10780 __Pyx_TraceLine(193,0,__PYX_ERR(1, 193, __pyx_L1_error))
10781 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__12, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 193, __pyx_L1_error)
10782 __Pyx_GOTREF(__pyx_t_3);
10783 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
10784 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10785 __PYX_ERR(1, 193, __pyx_L1_error)
10803 __Pyx_TraceLine(194,0,__PYX_ERR(1, 194, __pyx_L1_error))
10804 __pyx_t_4 = __pyx_v_self->data;
10805 __pyx_v_info->buf = __pyx_t_4;
10814 __Pyx_TraceLine(195,0,__PYX_ERR(1, 195, __pyx_L1_error))
10815 __pyx_t_5 = __pyx_v_self->len;
10816 __pyx_v_info->len = __pyx_t_5;
10825 __Pyx_TraceLine(196,0,__PYX_ERR(1, 196, __pyx_L1_error))
10826 __pyx_t_6 = __pyx_v_self->ndim;
10827 __pyx_v_info->ndim = __pyx_t_6;
10836 __Pyx_TraceLine(197,0,__PYX_ERR(1, 197, __pyx_L1_error))
10837 __pyx_t_7 = __pyx_v_self->_shape;
10838 __pyx_v_info->shape = __pyx_t_7;
10847 __Pyx_TraceLine(198,0,__PYX_ERR(1, 198, __pyx_L1_error))
10848 __pyx_t_7 = __pyx_v_self->_strides;
10849 __pyx_v_info->strides = __pyx_t_7;
10858 __Pyx_TraceLine(199,0,__PYX_ERR(1, 199, __pyx_L1_error))
10859 __pyx_v_info->suboffsets = NULL;
10868 __Pyx_TraceLine(200,0,__PYX_ERR(1, 200, __pyx_L1_error))
10869 __pyx_t_5 = __pyx_v_self->itemsize;
10870 __pyx_v_info->itemsize = __pyx_t_5;
10879 __Pyx_TraceLine(201,0,__PYX_ERR(1, 201, __pyx_L1_error))
10880 __pyx_v_info->readonly = 0;
10889 __Pyx_TraceLine(203,0,__PYX_ERR(1, 203, __pyx_L1_error))
10890 __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
10900 __Pyx_TraceLine(204,0,__PYX_ERR(1, 204, __pyx_L1_error))
10901 __pyx_t_4 = __pyx_v_self->format;
10902 __pyx_v_info->format = __pyx_t_4;
10921 __Pyx_TraceLine(206,0,__PYX_ERR(1, 206, __pyx_L1_error))
10923 __pyx_v_info->format = NULL;
10934 __Pyx_TraceLine(208,0,__PYX_ERR(1, 208, __pyx_L1_error))
10935 __Pyx_INCREF(((PyObject *)__pyx_v_self));
10936 __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
10937 __Pyx_GOTREF(__pyx_v_info->obj);
10938 __Pyx_DECREF(__pyx_v_info->obj);
10939 __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
10953 __Pyx_XDECREF(__pyx_t_3);
10954 __Pyx_AddTraceback(
"View.MemoryView.array.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10956 if (__pyx_v_info->obj != NULL) {
10957 __Pyx_GOTREF(__pyx_v_info->obj);
10958 __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
10962 if (__pyx_v_info->obj == Py_None) {
10963 __Pyx_GOTREF(__pyx_v_info->obj);
10964 __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
10967 __Pyx_TraceReturn(Py_None, 0);
10968 __Pyx_RefNannyFinishContext();
10981 static void __pyx_array___dealloc__(PyObject *__pyx_v_self);
10982 static void __pyx_array___dealloc__(PyObject *__pyx_v_self) {
10983 __Pyx_RefNannyDeclarations
10984 __Pyx_RefNannySetupContext(
"__dealloc__ (wrapper)", 0);
10985 __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(((
struct __pyx_array_obj *)__pyx_v_self));
10988 __Pyx_RefNannyFinishContext();
10991 static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(
struct __pyx_array_obj *__pyx_v_self) {
10992 __Pyx_TraceDeclarations
10993 __Pyx_RefNannyDeclarations
10995 int __pyx_lineno = 0;
10996 const char *__pyx_filename = NULL;
10997 int __pyx_clineno = 0;
10998 __Pyx_RefNannySetupContext(
"__dealloc__", 0);
10999 __Pyx_TraceCall(
"__dealloc__", __pyx_f[1], 212, 0, __PYX_ERR(1, 212, __pyx_L1_error));
11008 __Pyx_TraceLine(213,0,__PYX_ERR(1, 213, __pyx_L1_error))
11009 __pyx_t_1 = ((__pyx_v_self->callback_free_data != NULL) != 0);
11019 __Pyx_TraceLine(214,0,__PYX_ERR(1, 214, __pyx_L1_error))
11020 __pyx_v_self->callback_free_data(__pyx_v_self->data);
11039 __Pyx_TraceLine(215,0,__PYX_ERR(1, 215, __pyx_L1_error))
11040 __pyx_t_1 = (__pyx_v_self->free_data != 0);
11050 __Pyx_TraceLine(216,0,__PYX_ERR(1, 216, __pyx_L1_error))
11051 __pyx_t_1 = (__pyx_v_self->dtype_is_object != 0);
11061 __Pyx_TraceLine(217,0,__PYX_ERR(1, 217, __pyx_L1_error))
11062 __pyx_memoryview_refcount_objects_in_slice(__pyx_v_self->data, __pyx_v_self->_shape, __pyx_v_self->_strides, __pyx_v_self->ndim, 0);
11080 __Pyx_TraceLine(219,0,__PYX_ERR(1, 219, __pyx_L1_error))
11081 free(__pyx_v_self->data);
11100 __Pyx_TraceLine(220,0,__PYX_ERR(1, 220, __pyx_L1_error))
11101 PyObject_Free(__pyx_v_self->_shape);
11114 __Pyx_WriteUnraisable(
"View.MemoryView.array.__dealloc__", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
11116 __Pyx_TraceReturn(Py_None, 0);
11117 __Pyx_RefNannyFinishContext();
11129 static PyObject *__pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(PyObject *__pyx_v_self);
11130 static PyObject *__pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(PyObject *__pyx_v_self) {
11131 PyObject *__pyx_r = 0;
11132 __Pyx_RefNannyDeclarations
11133 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
11134 __pyx_r = __pyx_pf_15View_dot_MemoryView_5array_7memview___get__(((
struct __pyx_array_obj *)__pyx_v_self));
11137 __Pyx_RefNannyFinishContext();
11141 static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(
struct __pyx_array_obj *__pyx_v_self) {
11142 PyObject *__pyx_r = NULL;
11143 __Pyx_TraceDeclarations
11144 __Pyx_RefNannyDeclarations
11145 PyObject *__pyx_t_1 = NULL;
11146 int __pyx_lineno = 0;
11147 const char *__pyx_filename = NULL;
11148 int __pyx_clineno = 0;
11149 __Pyx_RefNannySetupContext(
"__get__", 0);
11150 __Pyx_TraceCall(
"__get__", __pyx_f[1], 223, 0, __PYX_ERR(1, 223, __pyx_L1_error));
11159 __Pyx_TraceLine(224,0,__PYX_ERR(1, 224, __pyx_L1_error))
11160 __Pyx_XDECREF(__pyx_r);
11161 __pyx_t_1 = ((
struct __pyx_vtabstruct_array *)__pyx_v_self->__pyx_vtab)->get_memview(__pyx_v_self);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 224, __pyx_L1_error)
11162 __Pyx_GOTREF(__pyx_t_1);
11163 __pyx_r = __pyx_t_1;
11177 __Pyx_XDECREF(__pyx_t_1);
11178 __Pyx_AddTraceback(
"View.MemoryView.array.memview.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11181 __Pyx_XGIVEREF(__pyx_r);
11182 __Pyx_TraceReturn(__pyx_r, 0);
11183 __Pyx_RefNannyFinishContext();
11195 static PyObject *__pyx_array_get_memview(
struct __pyx_array_obj *__pyx_v_self) {
11197 PyObject *__pyx_r = NULL;
11198 __Pyx_TraceDeclarations
11199 __Pyx_RefNannyDeclarations
11200 PyObject *__pyx_t_1 = NULL;
11201 PyObject *__pyx_t_2 = NULL;
11202 PyObject *__pyx_t_3 = NULL;
11203 int __pyx_lineno = 0;
11204 const char *__pyx_filename = NULL;
11205 int __pyx_clineno = 0;
11206 __Pyx_RefNannySetupContext(
"get_memview", 0);
11207 __Pyx_TraceCall(
"get_memview", __pyx_f[1], 227, 0, __PYX_ERR(1, 227, __pyx_L1_error));
11216 __Pyx_TraceLine(228,0,__PYX_ERR(1, 228, __pyx_L1_error))
11217 __pyx_v_flags = ((PyBUF_ANY_CONTIGUOUS | PyBUF_FORMAT) | PyBUF_WRITABLE);
11226 __Pyx_TraceLine(229,0,__PYX_ERR(1, 229, __pyx_L1_error))
11227 __Pyx_XDECREF(__pyx_r);
11228 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 229, __pyx_L1_error)
11229 __Pyx_GOTREF(__pyx_t_1);
11230 __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 229, __pyx_L1_error)
11231 __Pyx_GOTREF(__pyx_t_2);
11232 __pyx_t_3 = PyTuple_New(3);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 229, __pyx_L1_error)
11233 __Pyx_GOTREF(__pyx_t_3);
11234 __Pyx_INCREF(((PyObject *)__pyx_v_self));
11235 __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
11236 PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_self));
11237 __Pyx_GIVEREF(__pyx_t_1);
11238 PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
11239 __Pyx_GIVEREF(__pyx_t_2);
11240 PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
11243 __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_3, NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 229, __pyx_L1_error)
11244 __Pyx_GOTREF(__pyx_t_2);
11245 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11246 __pyx_r = __pyx_t_2;
11260 __Pyx_XDECREF(__pyx_t_1);
11261 __Pyx_XDECREF(__pyx_t_2);
11262 __Pyx_XDECREF(__pyx_t_3);
11263 __Pyx_AddTraceback(
"View.MemoryView.array.get_memview", __pyx_clineno, __pyx_lineno, __pyx_filename);
11266 __Pyx_XGIVEREF(__pyx_r);
11267 __Pyx_TraceReturn(__pyx_r, 0);
11268 __Pyx_RefNannyFinishContext();
11281 static Py_ssize_t __pyx_array___len__(PyObject *__pyx_v_self);
11282 static Py_ssize_t __pyx_array___len__(PyObject *__pyx_v_self) {
11283 Py_ssize_t __pyx_r;
11284 __Pyx_RefNannyDeclarations
11285 __Pyx_RefNannySetupContext(
"__len__ (wrapper)", 0);
11286 __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(((
struct __pyx_array_obj *)__pyx_v_self));
11289 __Pyx_RefNannyFinishContext();
11293 static Py_ssize_t __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(
struct __pyx_array_obj *__pyx_v_self) {
11294 Py_ssize_t __pyx_r;
11295 __Pyx_TraceDeclarations
11296 __Pyx_RefNannyDeclarations
11297 int __pyx_lineno = 0;
11298 const char *__pyx_filename = NULL;
11299 int __pyx_clineno = 0;
11300 __Pyx_RefNannySetupContext(
"__len__", 0);
11301 __Pyx_TraceCall(
"__len__", __pyx_f[1], 231, 0, __PYX_ERR(1, 231, __pyx_L1_error));
11310 __Pyx_TraceLine(232,0,__PYX_ERR(1, 232, __pyx_L1_error))
11311 __pyx_r = (__pyx_v_self->_shape[0]);
11324 __Pyx_AddTraceback(
"View.MemoryView.array.__len__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11327 __Pyx_TraceReturn(Py_None, 0);
11328 __Pyx_RefNannyFinishContext();
11341 static PyObject *__pyx_array___getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_attr);
11342 static PyObject *__pyx_array___getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_attr) {
11343 PyObject *__pyx_r = 0;
11344 __Pyx_RefNannyDeclarations
11345 __Pyx_RefNannySetupContext(
"__getattr__ (wrapper)", 0);
11346 __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(((
struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_attr));
11349 __Pyx_RefNannyFinishContext();
11353 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(
struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr) {
11354 PyObject *__pyx_r = NULL;
11355 __Pyx_TraceDeclarations
11356 __Pyx_RefNannyDeclarations
11357 PyObject *__pyx_t_1 = NULL;
11358 PyObject *__pyx_t_2 = NULL;
11359 int __pyx_lineno = 0;
11360 const char *__pyx_filename = NULL;
11361 int __pyx_clineno = 0;
11362 __Pyx_RefNannySetupContext(
"__getattr__", 0);
11363 __Pyx_TraceCall(
"__getattr__", __pyx_f[1], 234, 0, __PYX_ERR(1, 234, __pyx_L1_error));
11372 __Pyx_TraceLine(235,0,__PYX_ERR(1, 235, __pyx_L1_error))
11373 __Pyx_XDECREF(__pyx_r);
11374 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 235, __pyx_L1_error)
11375 __Pyx_GOTREF(__pyx_t_1);
11376 __pyx_t_2 = __Pyx_GetAttr(__pyx_t_1, __pyx_v_attr);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 235, __pyx_L1_error)
11377 __Pyx_GOTREF(__pyx_t_2);
11378 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11379 __pyx_r = __pyx_t_2;
11393 __Pyx_XDECREF(__pyx_t_1);
11394 __Pyx_XDECREF(__pyx_t_2);
11395 __Pyx_AddTraceback(
"View.MemoryView.array.__getattr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11398 __Pyx_XGIVEREF(__pyx_r);
11399 __Pyx_TraceReturn(__pyx_r, 0);
11400 __Pyx_RefNannyFinishContext();
11413 static PyObject *__pyx_array___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item);
11414 static PyObject *__pyx_array___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item) {
11415 PyObject *__pyx_r = 0;
11416 __Pyx_RefNannyDeclarations
11417 __Pyx_RefNannySetupContext(
"__getitem__ (wrapper)", 0);
11418 __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(((
struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_item));
11421 __Pyx_RefNannyFinishContext();
11425 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(
struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item) {
11426 PyObject *__pyx_r = NULL;
11427 __Pyx_TraceDeclarations
11428 __Pyx_RefNannyDeclarations
11429 PyObject *__pyx_t_1 = NULL;
11430 PyObject *__pyx_t_2 = NULL;
11431 int __pyx_lineno = 0;
11432 const char *__pyx_filename = NULL;
11433 int __pyx_clineno = 0;
11434 __Pyx_RefNannySetupContext(
"__getitem__", 0);
11435 __Pyx_TraceCall(
"__getitem__", __pyx_f[1], 237, 0, __PYX_ERR(1, 237, __pyx_L1_error));
11444 __Pyx_TraceLine(238,0,__PYX_ERR(1, 238, __pyx_L1_error))
11445 __Pyx_XDECREF(__pyx_r);
11446 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 238, __pyx_L1_error)
11447 __Pyx_GOTREF(__pyx_t_1);
11448 __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_v_item);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 238, __pyx_L1_error)
11449 __Pyx_GOTREF(__pyx_t_2);
11450 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11451 __pyx_r = __pyx_t_2;
11465 __Pyx_XDECREF(__pyx_t_1);
11466 __Pyx_XDECREF(__pyx_t_2);
11467 __Pyx_AddTraceback(
"View.MemoryView.array.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11470 __Pyx_XGIVEREF(__pyx_r);
11471 __Pyx_TraceReturn(__pyx_r, 0);
11472 __Pyx_RefNannyFinishContext();
11485 static int __pyx_array___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value);
11486 static int __pyx_array___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value) {
11488 __Pyx_RefNannyDeclarations
11489 __Pyx_RefNannySetupContext(
"__setitem__ (wrapper)", 0);
11490 __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_12__setitem__(((
struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_item), ((PyObject *)__pyx_v_value));
11493 __Pyx_RefNannyFinishContext();
11497 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_12__setitem__(
struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value) {
11499 __Pyx_TraceDeclarations
11500 __Pyx_RefNannyDeclarations
11501 PyObject *__pyx_t_1 = NULL;
11502 int __pyx_lineno = 0;
11503 const char *__pyx_filename = NULL;
11504 int __pyx_clineno = 0;
11505 __Pyx_RefNannySetupContext(
"__setitem__", 0);
11506 __Pyx_TraceCall(
"__setitem__", __pyx_f[1], 240, 0, __PYX_ERR(1, 240, __pyx_L1_error));
11515 __Pyx_TraceLine(241,0,__PYX_ERR(1, 241, __pyx_L1_error))
11516 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 241, __pyx_L1_error)
11517 __Pyx_GOTREF(__pyx_t_1);
11518 if (unlikely(PyObject_SetItem(__pyx_t_1, __pyx_v_item, __pyx_v_value) < 0)) __PYX_ERR(1, 241, __pyx_L1_error)
11519 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11533 __Pyx_XDECREF(__pyx_t_1);
11534 __Pyx_AddTraceback(
"View.MemoryView.array.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11537 __Pyx_TraceReturn(Py_None, 0);
11538 __Pyx_RefNannyFinishContext();
11549 static PyObject *__pyx_pw___pyx_array_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
11550 static PyMethodDef __pyx_mdef___pyx_array_1__reduce_cython__ = {
"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_array_1__reduce_cython__, METH_NOARGS, 0};
11551 static PyObject *__pyx_pw___pyx_array_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
11552 PyObject *__pyx_r = 0;
11553 __Pyx_RefNannyDeclarations
11554 __Pyx_RefNannySetupContext(
"__reduce_cython__ (wrapper)", 0);
11555 __pyx_r = __pyx_pf___pyx_array___reduce_cython__(((
struct __pyx_array_obj *)__pyx_v_self));
11558 __Pyx_RefNannyFinishContext();
11562 static PyObject *__pyx_pf___pyx_array___reduce_cython__(CYTHON_UNUSED
struct __pyx_array_obj *__pyx_v_self) {
11563 PyObject *__pyx_r = NULL;
11564 __Pyx_TraceDeclarations
11565 __Pyx_RefNannyDeclarations
11566 PyObject *__pyx_t_1 = NULL;
11567 int __pyx_lineno = 0;
11568 const char *__pyx_filename = NULL;
11569 int __pyx_clineno = 0;
11570 __Pyx_RefNannySetupContext(
"__reduce_cython__", 0);
11571 __Pyx_TraceCall(
"__reduce_cython__", __pyx_f[1], 1, 0, __PYX_ERR(1, 1, __pyx_L1_error));
11579 __Pyx_TraceLine(2,0,__PYX_ERR(1, 2, __pyx_L1_error))
11580 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__13, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
11581 __Pyx_GOTREF(__pyx_t_1);
11582 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
11583 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11584 __PYX_ERR(1, 2, __pyx_L1_error)
11594 __Pyx_XDECREF(__pyx_t_1);
11595 __Pyx_AddTraceback(
"View.MemoryView.array.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11597 __Pyx_XGIVEREF(__pyx_r);
11598 __Pyx_TraceReturn(__pyx_r, 0);
11599 __Pyx_RefNannyFinishContext();
11611 static PyObject *__pyx_pw___pyx_array_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state);
11612 static PyMethodDef __pyx_mdef___pyx_array_3__setstate_cython__ = {
"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_array_3__setstate_cython__, METH_O, 0};
11613 static PyObject *__pyx_pw___pyx_array_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
11614 PyObject *__pyx_r = 0;
11615 __Pyx_RefNannyDeclarations
11616 __Pyx_RefNannySetupContext(
"__setstate_cython__ (wrapper)", 0);
11617 __pyx_r = __pyx_pf___pyx_array_2__setstate_cython__(((
struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
11620 __Pyx_RefNannyFinishContext();
11624 static PyObject *__pyx_pf___pyx_array_2__setstate_cython__(CYTHON_UNUSED
struct __pyx_array_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
11625 PyObject *__pyx_r = NULL;
11626 __Pyx_TraceDeclarations
11627 __Pyx_RefNannyDeclarations
11628 PyObject *__pyx_t_1 = NULL;
11629 int __pyx_lineno = 0;
11630 const char *__pyx_filename = NULL;
11631 int __pyx_clineno = 0;
11632 __Pyx_RefNannySetupContext(
"__setstate_cython__", 0);
11633 __Pyx_TraceCall(
"__setstate_cython__", __pyx_f[1], 3, 0, __PYX_ERR(1, 3, __pyx_L1_error));
11640 __Pyx_TraceLine(4,0,__PYX_ERR(1, 4, __pyx_L1_error))
11641 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__14, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
11642 __Pyx_GOTREF(__pyx_t_1);
11643 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
11644 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11645 __PYX_ERR(1, 4, __pyx_L1_error)
11656 __Pyx_XDECREF(__pyx_t_1);
11657 __Pyx_AddTraceback(
"View.MemoryView.array.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11659 __Pyx_XGIVEREF(__pyx_r);
11660 __Pyx_TraceReturn(__pyx_r, 0);
11661 __Pyx_RefNannyFinishContext();
11673 static struct __pyx_array_obj *__pyx_array_new(PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize,
char *__pyx_v_format,
char *__pyx_v_mode,
char *__pyx_v_buf) {
11674 struct __pyx_array_obj *__pyx_v_result = 0;
11675 struct __pyx_array_obj *__pyx_r = NULL;
11676 __Pyx_TraceDeclarations
11677 __Pyx_RefNannyDeclarations
11679 PyObject *__pyx_t_2 = NULL;
11680 PyObject *__pyx_t_3 = NULL;
11681 PyObject *__pyx_t_4 = NULL;
11682 PyObject *__pyx_t_5 = NULL;
11683 int __pyx_lineno = 0;
11684 const char *__pyx_filename = NULL;
11685 int __pyx_clineno = 0;
11686 __Pyx_RefNannySetupContext(
"array_cwrapper", 0);
11687 __Pyx_TraceCall(
"array_cwrapper", __pyx_f[1], 245, 0, __PYX_ERR(1, 245, __pyx_L1_error));
11696 __Pyx_TraceLine(249,0,__PYX_ERR(1, 249, __pyx_L1_error))
11697 __pyx_t_1 = ((__pyx_v_buf == NULL) != 0);
11707 __Pyx_TraceLine(250,0,__PYX_ERR(1, 250, __pyx_L1_error))
11708 __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_itemsize);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 250, __pyx_L1_error)
11709 __Pyx_GOTREF(__pyx_t_2);
11710 __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_format);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 250, __pyx_L1_error)
11711 __Pyx_GOTREF(__pyx_t_3);
11712 __pyx_t_4 = __Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 250, __pyx_L1_error)
11713 __Pyx_GOTREF(__pyx_t_4);
11714 __pyx_t_5 = PyTuple_New(4);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 250, __pyx_L1_error)
11715 __Pyx_GOTREF(__pyx_t_5);
11716 __Pyx_INCREF(__pyx_v_shape);
11717 __Pyx_GIVEREF(__pyx_v_shape);
11718 PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_shape);
11719 __Pyx_GIVEREF(__pyx_t_2);
11720 PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2);
11721 __Pyx_GIVEREF(__pyx_t_3);
11722 PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_3);
11723 __Pyx_GIVEREF(__pyx_t_4);
11724 PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_4);
11728 __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_array_type), __pyx_t_5, NULL);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 250, __pyx_L1_error)
11729 __Pyx_GOTREF(__pyx_t_4);
11730 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
11731 __pyx_v_result = ((
struct __pyx_array_obj *)__pyx_t_4);
11751 __Pyx_TraceLine(252,0,__PYX_ERR(1, 252, __pyx_L1_error))
11753 __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_itemsize);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 252, __pyx_L1_error)
11754 __Pyx_GOTREF(__pyx_t_4);
11755 __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_format);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 252, __pyx_L1_error)
11756 __Pyx_GOTREF(__pyx_t_5);
11757 __pyx_t_3 = __Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 252, __pyx_L1_error)
11758 __Pyx_GOTREF(__pyx_t_3);
11759 __pyx_t_2 = PyTuple_New(4);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 252, __pyx_L1_error)
11760 __Pyx_GOTREF(__pyx_t_2);
11761 __Pyx_INCREF(__pyx_v_shape);
11762 __Pyx_GIVEREF(__pyx_v_shape);
11763 PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_shape);
11764 __Pyx_GIVEREF(__pyx_t_4);
11765 PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_4);
11766 __Pyx_GIVEREF(__pyx_t_5);
11767 PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_5);
11768 __Pyx_GIVEREF(__pyx_t_3);
11769 PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_t_3);
11781 __Pyx_TraceLine(253,0,__PYX_ERR(1, 253, __pyx_L1_error))
11782 __pyx_t_3 = __Pyx_PyDict_NewPresized(1);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 253, __pyx_L1_error)
11783 __Pyx_GOTREF(__pyx_t_3);
11784 if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_allocate_buffer, Py_False) < 0) __PYX_ERR(1, 253, __pyx_L1_error)
11793 __Pyx_TraceLine(252,0,__PYX_ERR(1, 252, __pyx_L1_error))
11794 __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_array_type), __pyx_t_2, __pyx_t_3);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 252, __pyx_L1_error)
11795 __Pyx_GOTREF(__pyx_t_5);
11796 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11797 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11798 __pyx_v_result = ((
struct __pyx_array_obj *)__pyx_t_5);
11808 __Pyx_TraceLine(254,0,__PYX_ERR(1, 254, __pyx_L1_error))
11809 __pyx_v_result->data = __pyx_v_buf;
11820 __Pyx_TraceLine(256,0,__PYX_ERR(1, 256, __pyx_L1_error))
11821 __Pyx_XDECREF(((PyObject *)__pyx_r));
11822 __Pyx_INCREF(((PyObject *)__pyx_v_result));
11823 __pyx_r = __pyx_v_result;
11836 __Pyx_XDECREF(__pyx_t_2);
11837 __Pyx_XDECREF(__pyx_t_3);
11838 __Pyx_XDECREF(__pyx_t_4);
11839 __Pyx_XDECREF(__pyx_t_5);
11840 __Pyx_AddTraceback(
"View.MemoryView.array_cwrapper", __pyx_clineno, __pyx_lineno, __pyx_filename);
11843 __Pyx_XDECREF((PyObject *)__pyx_v_result);
11844 __Pyx_XGIVEREF((PyObject *)__pyx_r);
11845 __Pyx_TraceReturn(__pyx_r, 0);
11846 __Pyx_RefNannyFinishContext();
11859 static int __pyx_MemviewEnum___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
11860 static int __pyx_MemviewEnum___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
11861 PyObject *__pyx_v_name = 0;
11862 int __pyx_lineno = 0;
11863 const char *__pyx_filename = NULL;
11864 int __pyx_clineno = 0;
11866 __Pyx_RefNannyDeclarations
11867 __Pyx_RefNannySetupContext(
"__init__ (wrapper)", 0);
11869 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,0};
11870 PyObject* values[1] = {0};
11871 if (unlikely(__pyx_kwds)) {
11872 Py_ssize_t kw_args;
11873 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
11874 switch (pos_args) {
11875 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
11876 CYTHON_FALLTHROUGH;
11878 default:
goto __pyx_L5_argtuple_error;
11880 kw_args = PyDict_Size(__pyx_kwds);
11881 switch (pos_args) {
11883 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--;
11884 else goto __pyx_L5_argtuple_error;
11886 if (unlikely(kw_args > 0)) {
11887 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"__init__") < 0)) __PYX_ERR(1, 282, __pyx_L3_error)
11889 }
else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
11890 goto __pyx_L5_argtuple_error;
11892 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
11894 __pyx_v_name = values[0];
11896 goto __pyx_L4_argument_unpacking_done;
11897 __pyx_L5_argtuple_error:;
11898 __Pyx_RaiseArgtupleInvalid(
"__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 282, __pyx_L3_error)
11900 __Pyx_AddTraceback(
"View.MemoryView.Enum.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11901 __Pyx_RefNannyFinishContext();
11903 __pyx_L4_argument_unpacking_done:;
11904 __pyx_r = __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(((
struct __pyx_MemviewEnum_obj *)__pyx_v_self), __pyx_v_name);
11907 __Pyx_RefNannyFinishContext();
11911 static int __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(
struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v_name) {
11913 __Pyx_TraceDeclarations
11914 __Pyx_RefNannyDeclarations
11915 int __pyx_lineno = 0;
11916 const char *__pyx_filename = NULL;
11917 int __pyx_clineno = 0;
11918 __Pyx_RefNannySetupContext(
"__init__", 0);
11919 __Pyx_TraceCall(
"__init__", __pyx_f[1], 282, 0, __PYX_ERR(1, 282, __pyx_L1_error));
11928 __Pyx_TraceLine(283,0,__PYX_ERR(1, 283, __pyx_L1_error))
11929 __Pyx_INCREF(__pyx_v_name);
11930 __Pyx_GIVEREF(__pyx_v_name);
11931 __Pyx_GOTREF(__pyx_v_self->name);
11932 __Pyx_DECREF(__pyx_v_self->name);
11933 __pyx_v_self->name = __pyx_v_name;
11947 __Pyx_AddTraceback(
"View.MemoryView.Enum.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11950 __Pyx_TraceReturn(Py_None, 0);
11951 __Pyx_RefNannyFinishContext();
11964 static PyObject *__pyx_MemviewEnum___repr__(PyObject *__pyx_v_self);
11965 static PyObject *__pyx_MemviewEnum___repr__(PyObject *__pyx_v_self) {
11966 PyObject *__pyx_r = 0;
11967 __Pyx_RefNannyDeclarations
11968 __Pyx_RefNannySetupContext(
"__repr__ (wrapper)", 0);
11969 __pyx_r = __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(((
struct __pyx_MemviewEnum_obj *)__pyx_v_self));
11972 __Pyx_RefNannyFinishContext();
11976 static PyObject *__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(
struct __pyx_MemviewEnum_obj *__pyx_v_self) {
11977 PyObject *__pyx_r = NULL;
11978 __Pyx_TraceDeclarations
11979 __Pyx_RefNannyDeclarations
11980 int __pyx_lineno = 0;
11981 const char *__pyx_filename = NULL;
11982 int __pyx_clineno = 0;
11983 __Pyx_RefNannySetupContext(
"__repr__", 0);
11984 __Pyx_TraceCall(
"__repr__", __pyx_f[1], 284, 0, __PYX_ERR(1, 284, __pyx_L1_error));
11993 __Pyx_TraceLine(285,0,__PYX_ERR(1, 285, __pyx_L1_error))
11994 __Pyx_XDECREF(__pyx_r);
11995 __Pyx_INCREF(__pyx_v_self->name);
11996 __pyx_r = __pyx_v_self->name;
12009 __Pyx_AddTraceback(
"View.MemoryView.Enum.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12012 __Pyx_XGIVEREF(__pyx_r);
12013 __Pyx_TraceReturn(__pyx_r, 0);
12014 __Pyx_RefNannyFinishContext();
12025 static PyObject *__pyx_pw___pyx_MemviewEnum_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
12026 static PyMethodDef __pyx_mdef___pyx_MemviewEnum_1__reduce_cython__ = {
"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_MemviewEnum_1__reduce_cython__, METH_NOARGS, 0};
12027 static PyObject *__pyx_pw___pyx_MemviewEnum_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
12028 PyObject *__pyx_r = 0;
12029 __Pyx_RefNannyDeclarations
12030 __Pyx_RefNannySetupContext(
"__reduce_cython__ (wrapper)", 0);
12031 __pyx_r = __pyx_pf___pyx_MemviewEnum___reduce_cython__(((
struct __pyx_MemviewEnum_obj *)__pyx_v_self));
12034 __Pyx_RefNannyFinishContext();
12038 static PyObject *__pyx_pf___pyx_MemviewEnum___reduce_cython__(
struct __pyx_MemviewEnum_obj *__pyx_v_self) {
12039 PyObject *__pyx_v_state = 0;
12040 PyObject *__pyx_v__dict = 0;
12041 int __pyx_v_use_setstate;
12042 PyObject *__pyx_r = NULL;
12043 __Pyx_TraceDeclarations
12044 __Pyx_RefNannyDeclarations
12045 PyObject *__pyx_t_1 = NULL;
12048 PyObject *__pyx_t_4 = NULL;
12049 PyObject *__pyx_t_5 = NULL;
12050 int __pyx_lineno = 0;
12051 const char *__pyx_filename = NULL;
12052 int __pyx_clineno = 0;
12053 __Pyx_RefNannySetupContext(
"__reduce_cython__", 0);
12054 __Pyx_TraceCall(
"__reduce_cython__", __pyx_f[1], 1, 0, __PYX_ERR(1, 1, __pyx_L1_error));
12063 __Pyx_TraceLine(5,0,__PYX_ERR(1, 5, __pyx_L1_error))
12064 __pyx_t_1 = PyTuple_New(1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error)
12065 __Pyx_GOTREF(__pyx_t_1);
12066 __Pyx_INCREF(__pyx_v_self->name);
12067 __Pyx_GIVEREF(__pyx_v_self->name);
12068 PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self->name);
12069 __pyx_v_state = ((PyObject*)__pyx_t_1);
12079 __Pyx_TraceLine(6,0,__PYX_ERR(1, 6, __pyx_L1_error))
12080 __pyx_t_1 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 6, __pyx_L1_error)
12081 __Pyx_GOTREF(__pyx_t_1);
12082 __pyx_v__dict = __pyx_t_1;
12092 __Pyx_TraceLine(7,0,__PYX_ERR(1, 7, __pyx_L1_error))
12093 __pyx_t_2 = (__pyx_v__dict != Py_None);
12094 __pyx_t_3 = (__pyx_t_2 != 0);
12104 __Pyx_TraceLine(8,0,__PYX_ERR(1, 8, __pyx_L1_error))
12105 __pyx_t_1 = PyTuple_New(1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 8, __pyx_L1_error)
12106 __Pyx_GOTREF(__pyx_t_1);
12107 __Pyx_INCREF(__pyx_v__dict);
12108 __Pyx_GIVEREF(__pyx_v__dict);
12109 PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v__dict);
12110 __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 8, __pyx_L1_error)
12111 __Pyx_GOTREF(__pyx_t_4);
12112 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12113 __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_4));
12123 __Pyx_TraceLine(9,0,__PYX_ERR(1, 9, __pyx_L1_error))
12124 __pyx_v_use_setstate = 1;
12143 __Pyx_TraceLine(11,0,__PYX_ERR(1, 11, __pyx_L1_error))
12145 __pyx_t_3 = (__pyx_v_self->name != Py_None);
12146 __pyx_v_use_setstate = __pyx_t_3;
12157 __Pyx_TraceLine(12,0,__PYX_ERR(1, 12, __pyx_L1_error))
12158 __pyx_t_3 = (__pyx_v_use_setstate != 0);
12168 __Pyx_TraceLine(13,0,__PYX_ERR(1, 13, __pyx_L1_error))
12169 __Pyx_XDECREF(__pyx_r);
12170 __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_pyx_unpickle_Enum);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 13, __pyx_L1_error)
12171 __Pyx_GOTREF(__pyx_t_4);
12172 __pyx_t_1 = PyTuple_New(3);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 13, __pyx_L1_error)
12173 __Pyx_GOTREF(__pyx_t_1);
12174 __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
12175 __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
12176 PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
12177 __Pyx_INCREF(__pyx_int_184977713);
12178 __Pyx_GIVEREF(__pyx_int_184977713);
12179 PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_184977713);
12180 __Pyx_INCREF(Py_None);
12181 __Pyx_GIVEREF(Py_None);
12182 PyTuple_SET_ITEM(__pyx_t_1, 2, Py_None);
12183 __pyx_t_5 = PyTuple_New(3);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 13, __pyx_L1_error)
12184 __Pyx_GOTREF(__pyx_t_5);
12185 __Pyx_GIVEREF(__pyx_t_4);
12186 PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
12187 __Pyx_GIVEREF(__pyx_t_1);
12188 PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_1);
12189 __Pyx_INCREF(__pyx_v_state);
12190 __Pyx_GIVEREF(__pyx_v_state);
12191 PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_state);
12194 __pyx_r = __pyx_t_5;
12214 __Pyx_TraceLine(15,0,__PYX_ERR(1, 15, __pyx_L1_error))
12216 __Pyx_XDECREF(__pyx_r);
12217 __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_pyx_unpickle_Enum);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 15, __pyx_L1_error)
12218 __Pyx_GOTREF(__pyx_t_5);
12219 __pyx_t_1 = PyTuple_New(3);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 15, __pyx_L1_error)
12220 __Pyx_GOTREF(__pyx_t_1);
12221 __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
12222 __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
12223 PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
12224 __Pyx_INCREF(__pyx_int_184977713);
12225 __Pyx_GIVEREF(__pyx_int_184977713);
12226 PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_184977713);
12227 __Pyx_INCREF(__pyx_v_state);
12228 __Pyx_GIVEREF(__pyx_v_state);
12229 PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_state);
12230 __pyx_t_4 = PyTuple_New(2);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 15, __pyx_L1_error)
12231 __Pyx_GOTREF(__pyx_t_4);
12232 __Pyx_GIVEREF(__pyx_t_5);
12233 PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5);
12234 __Pyx_GIVEREF(__pyx_t_1);
12235 PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1);
12238 __pyx_r = __pyx_t_4;
12251 __Pyx_XDECREF(__pyx_t_1);
12252 __Pyx_XDECREF(__pyx_t_4);
12253 __Pyx_XDECREF(__pyx_t_5);
12254 __Pyx_AddTraceback(
"View.MemoryView.Enum.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12257 __Pyx_XDECREF(__pyx_v_state);
12258 __Pyx_XDECREF(__pyx_v__dict);
12259 __Pyx_XGIVEREF(__pyx_r);
12260 __Pyx_TraceReturn(__pyx_r, 0);
12261 __Pyx_RefNannyFinishContext();
12273 static PyObject *__pyx_pw___pyx_MemviewEnum_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state);
12274 static PyMethodDef __pyx_mdef___pyx_MemviewEnum_3__setstate_cython__ = {
"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_MemviewEnum_3__setstate_cython__, METH_O, 0};
12275 static PyObject *__pyx_pw___pyx_MemviewEnum_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
12276 PyObject *__pyx_r = 0;
12277 __Pyx_RefNannyDeclarations
12278 __Pyx_RefNannySetupContext(
"__setstate_cython__ (wrapper)", 0);
12279 __pyx_r = __pyx_pf___pyx_MemviewEnum_2__setstate_cython__(((
struct __pyx_MemviewEnum_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
12282 __Pyx_RefNannyFinishContext();
12286 static PyObject *__pyx_pf___pyx_MemviewEnum_2__setstate_cython__(
struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
12287 PyObject *__pyx_r = NULL;
12288 __Pyx_TraceDeclarations
12289 __Pyx_RefNannyDeclarations
12290 PyObject *__pyx_t_1 = NULL;
12291 int __pyx_lineno = 0;
12292 const char *__pyx_filename = NULL;
12293 int __pyx_clineno = 0;
12294 __Pyx_RefNannySetupContext(
"__setstate_cython__", 0);
12295 __Pyx_TraceCall(
"__setstate_cython__", __pyx_f[1], 16, 0, __PYX_ERR(1, 16, __pyx_L1_error));
12302 __Pyx_TraceLine(17,0,__PYX_ERR(1, 17, __pyx_L1_error))
12303 if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||((
void)PyErr_Format(PyExc_TypeError,
"Expected %.16s, got %.200s",
"tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 17, __pyx_L1_error)
12304 __pyx_t_1 = __pyx_unpickle_Enum__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state));
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 17, __pyx_L1_error)
12305 __Pyx_GOTREF(__pyx_t_1);
12306 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12316 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
12319 __Pyx_XDECREF(__pyx_t_1);
12320 __Pyx_AddTraceback(
"View.MemoryView.Enum.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12323 __Pyx_XGIVEREF(__pyx_r);
12324 __Pyx_TraceReturn(__pyx_r, 0);
12325 __Pyx_RefNannyFinishContext();
12337 static void *__pyx_align_pointer(
void *__pyx_v_memory,
size_t __pyx_v_alignment) {
12338 Py_intptr_t __pyx_v_aligned_p;
12339 size_t __pyx_v_offset;
12341 __Pyx_TraceDeclarations
12343 int __pyx_lineno = 0;
12344 const char *__pyx_filename = NULL;
12345 int __pyx_clineno = 0;
12346 __Pyx_TraceCall(
"align_pointer", __pyx_f[1], 299, 1, __PYX_ERR(1, 299, __pyx_L1_error));
12355 __Pyx_TraceLine(301,1,__PYX_ERR(1, 301, __pyx_L1_error))
12356 __pyx_v_aligned_p = ((Py_intptr_t)__pyx_v_memory);
12365 __pyx_v_offset = (__pyx_v_aligned_p % __pyx_v_alignment);
12374 __Pyx_TraceLine(307,1,__PYX_ERR(1, 307, __pyx_L1_error))
12375 __pyx_t_1 = ((__pyx_v_offset > 0) != 0);
12385 __Pyx_TraceLine(308,1,__PYX_ERR(1, 308, __pyx_L1_error))
12386 __pyx_v_aligned_p = (__pyx_v_aligned_p + (__pyx_v_alignment - __pyx_v_offset));
12404 __Pyx_TraceLine(310,1,__PYX_ERR(1, 310, __pyx_L1_error))
12405 __pyx_r = ((
void *)__pyx_v_aligned_p);
12418 __Pyx_WriteUnraisable(
"View.MemoryView.align_pointer", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
12421 __Pyx_TraceReturn(Py_None, 1);
12434 static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
12435 static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
12436 PyObject *__pyx_v_obj = 0;
12438 int __pyx_v_dtype_is_object;
12439 int __pyx_lineno = 0;
12440 const char *__pyx_filename = NULL;
12441 int __pyx_clineno = 0;
12443 __Pyx_RefNannyDeclarations
12444 __Pyx_RefNannySetupContext(
"__cinit__ (wrapper)", 0);
12446 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_flags,&__pyx_n_s_dtype_is_object,0};
12447 PyObject* values[3] = {0,0,0};
12448 if (unlikely(__pyx_kwds)) {
12449 Py_ssize_t kw_args;
12450 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
12451 switch (pos_args) {
12452 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
12453 CYTHON_FALLTHROUGH;
12454 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
12455 CYTHON_FALLTHROUGH;
12456 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
12457 CYTHON_FALLTHROUGH;
12459 default:
goto __pyx_L5_argtuple_error;
12461 kw_args = PyDict_Size(__pyx_kwds);
12462 switch (pos_args) {
12464 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
12465 else goto __pyx_L5_argtuple_error;
12466 CYTHON_FALLTHROUGH;
12468 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_flags)) != 0)) kw_args--;
12470 __Pyx_RaiseArgtupleInvalid(
"__cinit__", 0, 2, 3, 1); __PYX_ERR(1, 346, __pyx_L3_error)
12472 CYTHON_FALLTHROUGH;
12475 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dtype_is_object);
12476 if (value) { values[2] = value; kw_args--; }
12479 if (unlikely(kw_args > 0)) {
12480 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"__cinit__") < 0)) __PYX_ERR(1, 346, __pyx_L3_error)
12483 switch (PyTuple_GET_SIZE(__pyx_args)) {
12484 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
12485 CYTHON_FALLTHROUGH;
12486 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
12487 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
12489 default:
goto __pyx_L5_argtuple_error;
12492 __pyx_v_obj = values[0];
12493 __pyx_v_flags = __Pyx_PyInt_As_int(values[1]);
if (unlikely((__pyx_v_flags == (
int)-1) && PyErr_Occurred())) __PYX_ERR(1, 346, __pyx_L3_error)
12495 __pyx_v_dtype_is_object = __Pyx_PyObject_IsTrue(values[2]);
if (unlikely((__pyx_v_dtype_is_object == (
int)-1) && PyErr_Occurred())) __PYX_ERR(1, 346, __pyx_L3_error)
12497 __pyx_v_dtype_is_object = ((int)0);
12500 goto __pyx_L4_argument_unpacking_done;
12501 __pyx_L5_argtuple_error:;
12502 __Pyx_RaiseArgtupleInvalid(
"__cinit__", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 346, __pyx_L3_error)
12504 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12505 __Pyx_RefNannyFinishContext();
12507 __pyx_L4_argument_unpacking_done:;
12508 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit__(((
struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_obj, __pyx_v_flags, __pyx_v_dtype_is_object);
12511 __Pyx_RefNannyFinishContext();
12515 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit__(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj,
int __pyx_v_flags,
int __pyx_v_dtype_is_object) {
12517 __Pyx_TraceDeclarations
12518 __Pyx_RefNannyDeclarations
12523 int __pyx_lineno = 0;
12524 const char *__pyx_filename = NULL;
12525 int __pyx_clineno = 0;
12526 __Pyx_RefNannySetupContext(
"__cinit__", 0);
12527 __Pyx_TraceCall(
"__cinit__", __pyx_f[1], 346, 0, __PYX_ERR(1, 346, __pyx_L1_error));
12536 __Pyx_TraceLine(347,0,__PYX_ERR(1, 347, __pyx_L1_error))
12537 __Pyx_INCREF(__pyx_v_obj);
12538 __Pyx_GIVEREF(__pyx_v_obj);
12539 __Pyx_GOTREF(__pyx_v_self->obj);
12540 __Pyx_DECREF(__pyx_v_self->obj);
12541 __pyx_v_self->obj = __pyx_v_obj;
12550 __Pyx_TraceLine(348,0,__PYX_ERR(1, 348, __pyx_L1_error))
12551 __pyx_v_self->flags = __pyx_v_flags;
12560 __Pyx_TraceLine(349,0,__PYX_ERR(1, 349, __pyx_L1_error))
12561 __pyx_t_2 = (((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))) == ((PyObject *)__pyx_memoryview_type));
12562 __pyx_t_3 = (__pyx_t_2 != 0);
12565 __pyx_t_1 = __pyx_t_3;
12566 goto __pyx_L4_bool_binop_done;
12568 __pyx_t_3 = (__pyx_v_obj != Py_None);
12569 __pyx_t_2 = (__pyx_t_3 != 0);
12570 __pyx_t_1 = __pyx_t_2;
12571 __pyx_L4_bool_binop_done:;
12581 __Pyx_TraceLine(350,0,__PYX_ERR(1, 350, __pyx_L1_error))
12582 __pyx_t_4 = __Pyx_GetBuffer(__pyx_v_obj, (&__pyx_v_self->view), __pyx_v_flags);
if (unlikely(__pyx_t_4 == ((
int)-1))) __PYX_ERR(1, 350, __pyx_L1_error)
12591 __Pyx_TraceLine(351,0,__PYX_ERR(1, 351, __pyx_L1_error))
12592 __pyx_t_1 = ((((PyObject *)__pyx_v_self->view.obj) == NULL) != 0);
12602 __Pyx_TraceLine(352,0,__PYX_ERR(1, 352, __pyx_L1_error))
12603 ((Py_buffer *)(&__pyx_v_self->view))->obj = Py_None;
12612 __Pyx_TraceLine(353,0,__PYX_ERR(1, 353, __pyx_L1_error))
12613 Py_INCREF(Py_None);
12640 __Pyx_TraceLine(355,0,__PYX_ERR(1, 355, __pyx_L1_error))
12641 __pyx_t_1 = ((!(__PYX_CYTHON_ATOMICS_ENABLED() != 0)) != 0);
12651 __Pyx_TraceLine(357,0,__PYX_ERR(1, 357, __pyx_L1_error))
12652 __pyx_t_1 = ((__pyx_memoryview_thread_locks_used < 8) != 0);
12662 __Pyx_TraceLine(358,0,__PYX_ERR(1, 358, __pyx_L1_error))
12663 __pyx_v_self->lock = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]);
12672 __Pyx_TraceLine(359,0,__PYX_ERR(1, 359, __pyx_L1_error))
12673 __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used + 1);
12691 __Pyx_TraceLine(360,0,__PYX_ERR(1, 360, __pyx_L1_error))
12692 __pyx_t_1 = ((__pyx_v_self->lock == NULL) != 0);
12702 __Pyx_TraceLine(361,0,__PYX_ERR(1, 361, __pyx_L1_error))
12703 __pyx_v_self->lock = PyThread_allocate_lock();
12712 __Pyx_TraceLine(362,0,__PYX_ERR(1, 362, __pyx_L1_error))
12713 __pyx_t_1 = ((__pyx_v_self->lock == NULL) != 0);
12714 if (unlikely(__pyx_t_1)) {
12723 __Pyx_TraceLine(363,0,__PYX_ERR(1, 363, __pyx_L1_error))
12724 PyErr_NoMemory(); __PYX_ERR(1, 363, __pyx_L1_error)
12760 __Pyx_TraceLine(365,0,__PYX_ERR(1, 365, __pyx_L1_error))
12761 __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
12771 __Pyx_TraceLine(366,0,__PYX_ERR(1, 366, __pyx_L1_error))
12772 __pyx_t_2 = (((__pyx_v_self->view.format[0]) ==
'O') != 0);
12775 __pyx_t_1 = __pyx_t_2;
12776 goto __pyx_L12_bool_binop_done;
12778 __pyx_t_2 = (((__pyx_v_self->view.format[1]) ==
'\x00') != 0);
12779 __pyx_t_1 = __pyx_t_2;
12780 __pyx_L12_bool_binop_done:;
12781 __pyx_v_self->dtype_is_object = __pyx_t_1;
12800 __Pyx_TraceLine(368,0,__PYX_ERR(1, 368, __pyx_L1_error))
12802 __pyx_v_self->dtype_is_object = __pyx_v_dtype_is_object;
12813 __Pyx_TraceLine(370,0,__PYX_ERR(1, 370, __pyx_L1_error))
12814 __pyx_v_self->acquisition_count_aligned_p = ((__pyx_atomic_int *)__pyx_align_pointer(((
void *)(&(__pyx_v_self->acquisition_count[0]))), (
sizeof(__pyx_atomic_int))));
12823 __Pyx_TraceLine(372,0,__PYX_ERR(1, 372, __pyx_L1_error))
12824 __pyx_v_self->typeinfo = NULL;
12838 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12841 __Pyx_TraceReturn(Py_None, 0);
12842 __Pyx_RefNannyFinishContext();
12855 static void __pyx_memoryview___dealloc__(PyObject *__pyx_v_self);
12856 static void __pyx_memoryview___dealloc__(PyObject *__pyx_v_self) {
12857 __Pyx_RefNannyDeclarations
12858 __Pyx_RefNannySetupContext(
"__dealloc__ (wrapper)", 0);
12859 __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
12862 __Pyx_RefNannyFinishContext();
12865 static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(
struct __pyx_memoryview_obj *__pyx_v_self) {
12867 __Pyx_TraceDeclarations
12868 __Pyx_RefNannyDeclarations
12874 PyThread_type_lock __pyx_t_6;
12875 PyThread_type_lock __pyx_t_7;
12876 int __pyx_lineno = 0;
12877 const char *__pyx_filename = NULL;
12878 int __pyx_clineno = 0;
12879 __Pyx_RefNannySetupContext(
"__dealloc__", 0);
12880 __Pyx_TraceCall(
"__dealloc__", __pyx_f[1], 374, 0, __PYX_ERR(1, 374, __pyx_L1_error));
12889 __Pyx_TraceLine(375,0,__PYX_ERR(1, 375, __pyx_L1_error))
12890 __pyx_t_1 = (__pyx_v_self->obj != Py_None);
12891 __pyx_t_2 = (__pyx_t_1 != 0);
12901 __Pyx_TraceLine(376,0,__PYX_ERR(1, 376, __pyx_L1_error))
12902 __Pyx_ReleaseBuffer((&__pyx_v_self->view));
12921 __Pyx_TraceLine(377,0,__PYX_ERR(1, 377, __pyx_L1_error))
12922 __pyx_t_2 = ((((Py_buffer *)(&__pyx_v_self->view))->obj == Py_None) != 0);
12932 __Pyx_TraceLine(379,0,__PYX_ERR(1, 379, __pyx_L1_error))
12933 ((Py_buffer *)(&__pyx_v_self->view))->obj = NULL;
12942 __Pyx_TraceLine(380,0,__PYX_ERR(1, 380, __pyx_L1_error))
12943 Py_DECREF(Py_None);
12962 __Pyx_TraceLine(384,0,__PYX_ERR(1, 384, __pyx_L1_error))
12963 __pyx_t_2 = ((__pyx_v_self->lock != NULL) != 0);
12973 __Pyx_TraceLine(385,0,__PYX_ERR(1, 385, __pyx_L1_error))
12974 __pyx_t_3 = __pyx_memoryview_thread_locks_used;
12975 __pyx_t_4 = __pyx_t_3;
12976 for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
12977 __pyx_v_i = __pyx_t_5;
12986 __Pyx_TraceLine(386,0,__PYX_ERR(1, 386, __pyx_L1_error))
12987 __pyx_t_2 = (((__pyx_memoryview_thread_locks[__pyx_v_i]) == __pyx_v_self->lock) != 0);
12997 __Pyx_TraceLine(387,0,__PYX_ERR(1, 387, __pyx_L1_error))
12998 __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used - 1);
13007 __Pyx_TraceLine(388,0,__PYX_ERR(1, 388, __pyx_L1_error))
13008 __pyx_t_2 = ((__pyx_v_i != __pyx_memoryview_thread_locks_used) != 0);
13018 __Pyx_TraceLine(390,0,__PYX_ERR(1, 390, __pyx_L1_error))
13019 __pyx_t_6 = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]);
13020 __pyx_t_7 = (__pyx_memoryview_thread_locks[__pyx_v_i]);
13029 __Pyx_TraceLine(389,0,__PYX_ERR(1, 389, __pyx_L1_error))
13030 (__pyx_memoryview_thread_locks[__pyx_v_i]) = __pyx_t_6;
13031 (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]) = __pyx_t_7;
13049 __Pyx_TraceLine(391,0,__PYX_ERR(1, 391, __pyx_L1_error))
13050 goto __pyx_L6_break;
13070 __Pyx_TraceLine(393,0,__PYX_ERR(1, 393, __pyx_L1_error))
13071 PyThread_free_lock(__pyx_v_self->lock);
13095 __Pyx_WriteUnraisable(
"View.MemoryView.memoryview.__dealloc__", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
13097 __Pyx_TraceReturn(Py_None, 0);
13098 __Pyx_RefNannyFinishContext();
13109 static char *__pyx_memoryview_get_item_pointer(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index) {
13110 Py_ssize_t __pyx_v_dim;
13111 char *__pyx_v_itemp;
13112 PyObject *__pyx_v_idx = NULL;
13114 __Pyx_TraceDeclarations
13115 __Pyx_RefNannyDeclarations
13116 Py_ssize_t __pyx_t_1;
13117 PyObject *__pyx_t_2 = NULL;
13118 Py_ssize_t __pyx_t_3;
13119 PyObject *(*__pyx_t_4)(PyObject *);
13120 PyObject *__pyx_t_5 = NULL;
13121 Py_ssize_t __pyx_t_6;
13123 int __pyx_lineno = 0;
13124 const char *__pyx_filename = NULL;
13125 int __pyx_clineno = 0;
13126 __Pyx_RefNannySetupContext(
"get_item_pointer", 0);
13127 __Pyx_TraceCall(
"get_item_pointer", __pyx_f[1], 395, 0, __PYX_ERR(1, 395, __pyx_L1_error));
13136 __Pyx_TraceLine(397,0,__PYX_ERR(1, 397, __pyx_L1_error))
13137 __pyx_v_itemp = ((
char *)__pyx_v_self->view.buf);
13146 __Pyx_TraceLine(399,0,__PYX_ERR(1, 399, __pyx_L1_error))
13148 if (likely(PyList_CheckExact(__pyx_v_index)) || PyTuple_CheckExact(__pyx_v_index)) {
13149 __pyx_t_2 = __pyx_v_index; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
13152 __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_index);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 399, __pyx_L1_error)
13153 __Pyx_GOTREF(__pyx_t_2);
13154 __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext;
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 399, __pyx_L1_error)
13157 if (likely(!__pyx_t_4)) {
13158 if (likely(PyList_CheckExact(__pyx_t_2))) {
13159 if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2))
break;
13160 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
13161 __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++;
if (unlikely(0 < 0)) __PYX_ERR(1, 399, __pyx_L1_error)
13163 __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++;
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 399, __pyx_L1_error)
13164 __Pyx_GOTREF(__pyx_t_5);
13167 if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2))
break;
13168 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
13169 __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++;
if (unlikely(0 < 0)) __PYX_ERR(1, 399, __pyx_L1_error)
13171 __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++;
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 399, __pyx_L1_error)
13172 __Pyx_GOTREF(__pyx_t_5);
13176 __pyx_t_5 = __pyx_t_4(__pyx_t_2);
13177 if (unlikely(!__pyx_t_5)) {
13178 PyObject* exc_type = PyErr_Occurred();
13180 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
13181 else __PYX_ERR(1, 399, __pyx_L1_error)
13185 __Pyx_GOTREF(__pyx_t_5);
13187 __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_5);
13189 __pyx_v_dim = __pyx_t_1;
13190 __pyx_t_1 = (__pyx_t_1 + 1);
13199 __Pyx_TraceLine(400,0,__PYX_ERR(1, 400, __pyx_L1_error))
13200 __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_v_idx);
if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 400, __pyx_L1_error)
13201 __pyx_t_7 = __pyx_pybuffer_index((&__pyx_v_self->view), __pyx_v_itemp, __pyx_t_6, __pyx_v_dim);
if (unlikely(__pyx_t_7 == ((
char *)NULL))) __PYX_ERR(1, 400, __pyx_L1_error)
13202 __pyx_v_itemp = __pyx_t_7;
13211 __Pyx_TraceLine(399,0,__PYX_ERR(1, 399, __pyx_L1_error))
13213 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13222 __Pyx_TraceLine(402,0,__PYX_ERR(1, 402, __pyx_L1_error))
13223 __pyx_r = __pyx_v_itemp;
13236 __Pyx_XDECREF(__pyx_t_2);
13237 __Pyx_XDECREF(__pyx_t_5);
13238 __Pyx_AddTraceback(
"View.MemoryView.memoryview.get_item_pointer", __pyx_clineno, __pyx_lineno, __pyx_filename);
13241 __Pyx_XDECREF(__pyx_v_idx);
13242 __Pyx_TraceReturn(Py_None, 0);
13243 __Pyx_RefNannyFinishContext();
13256 static PyObject *__pyx_memoryview___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index);
13257 static PyObject *__pyx_memoryview___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index) {
13258 PyObject *__pyx_r = 0;
13259 __Pyx_RefNannyDeclarations
13260 __Pyx_RefNannySetupContext(
"__getitem__ (wrapper)", 0);
13261 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(((
struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v_index));
13264 __Pyx_RefNannyFinishContext();
13268 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index) {
13269 PyObject *__pyx_v_have_slices = NULL;
13270 PyObject *__pyx_v_indices = NULL;
13271 char *__pyx_v_itemp;
13272 PyObject *__pyx_r = NULL;
13273 __Pyx_TraceDeclarations
13274 __Pyx_RefNannyDeclarations
13277 PyObject *__pyx_t_3 = NULL;
13278 PyObject *__pyx_t_4 = NULL;
13279 PyObject *__pyx_t_5 = NULL;
13281 int __pyx_lineno = 0;
13282 const char *__pyx_filename = NULL;
13283 int __pyx_clineno = 0;
13284 __Pyx_RefNannySetupContext(
"__getitem__", 0);
13285 __Pyx_TraceCall(
"__getitem__", __pyx_f[1], 405, 0, __PYX_ERR(1, 405, __pyx_L1_error));
13294 __Pyx_TraceLine(406,0,__PYX_ERR(1, 406, __pyx_L1_error))
13295 __pyx_t_1 = (__pyx_v_index == __pyx_builtin_Ellipsis);
13296 __pyx_t_2 = (__pyx_t_1 != 0);
13306 __Pyx_TraceLine(407,0,__PYX_ERR(1, 407, __pyx_L1_error))
13307 __Pyx_XDECREF(__pyx_r);
13308 __Pyx_INCREF(((PyObject *)__pyx_v_self));
13309 __pyx_r = ((PyObject *)__pyx_v_self);
13328 __Pyx_TraceLine(409,0,__PYX_ERR(1, 409, __pyx_L1_error))
13329 __pyx_t_3 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 409, __pyx_L1_error)
13330 __Pyx_GOTREF(__pyx_t_3);
13331 if (likely(__pyx_t_3 != Py_None)) {
13332 PyObject* sequence = __pyx_t_3;
13333 Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
13334 if (unlikely(size != 2)) {
13335 if (size > 2) __Pyx_RaiseTooManyValuesError(2);
13336 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
13337 __PYX_ERR(1, 409, __pyx_L1_error)
13339 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
13340 __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0);
13341 __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1);
13342 __Pyx_INCREF(__pyx_t_4);
13343 __Pyx_INCREF(__pyx_t_5);
13345 __pyx_t_4 = PySequence_ITEM(sequence, 0);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 409, __pyx_L1_error)
13346 __Pyx_GOTREF(__pyx_t_4);
13347 __pyx_t_5 = PySequence_ITEM(sequence, 1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 409, __pyx_L1_error)
13348 __Pyx_GOTREF(__pyx_t_5);
13350 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13352 __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 409, __pyx_L1_error)
13354 __pyx_v_have_slices = __pyx_t_4;
13356 __pyx_v_indices = __pyx_t_5;
13366 __Pyx_TraceLine(412,0,__PYX_ERR(1, 412, __pyx_L1_error))
13367 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices);
if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(1, 412, __pyx_L1_error)
13377 __Pyx_TraceLine(413,0,__PYX_ERR(1, 413, __pyx_L1_error))
13378 __Pyx_XDECREF(__pyx_r);
13379 __pyx_t_3 = ((PyObject *)__pyx_memview_slice(__pyx_v_self, __pyx_v_indices));
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 413, __pyx_L1_error)
13380 __Pyx_GOTREF(__pyx_t_3);
13381 __pyx_r = __pyx_t_3;
13401 __Pyx_TraceLine(415,0,__PYX_ERR(1, 415, __pyx_L1_error))
13403 __pyx_t_6 = ((
struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_indices);
if (unlikely(__pyx_t_6 == ((
char *)NULL))) __PYX_ERR(1, 415, __pyx_L1_error)
13404 __pyx_v_itemp = __pyx_t_6;
13413 __Pyx_TraceLine(416,0,__PYX_ERR(1, 416, __pyx_L1_error))
13414 __Pyx_XDECREF(__pyx_r);
13415 __pyx_t_3 = ((
struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->convert_item_to_object(__pyx_v_self, __pyx_v_itemp);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 416, __pyx_L1_error)
13416 __Pyx_GOTREF(__pyx_t_3);
13417 __pyx_r = __pyx_t_3;
13432 __Pyx_XDECREF(__pyx_t_3);
13433 __Pyx_XDECREF(__pyx_t_4);
13434 __Pyx_XDECREF(__pyx_t_5);
13435 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13438 __Pyx_XDECREF(__pyx_v_have_slices);
13439 __Pyx_XDECREF(__pyx_v_indices);
13440 __Pyx_XGIVEREF(__pyx_r);
13441 __Pyx_TraceReturn(__pyx_r, 0);
13442 __Pyx_RefNannyFinishContext();
13455 static int __pyx_memoryview___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value);
13456 static int __pyx_memoryview___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
13458 __Pyx_RefNannyDeclarations
13459 __Pyx_RefNannySetupContext(
"__setitem__ (wrapper)", 0);
13460 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(((
struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v_index), ((PyObject *)__pyx_v_value));
13463 __Pyx_RefNannyFinishContext();
13467 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
13468 PyObject *__pyx_v_have_slices = NULL;
13469 PyObject *__pyx_v_obj = NULL;
13471 __Pyx_TraceDeclarations
13472 __Pyx_RefNannyDeclarations
13474 PyObject *__pyx_t_2 = NULL;
13475 PyObject *__pyx_t_3 = NULL;
13476 PyObject *__pyx_t_4 = NULL;
13477 int __pyx_lineno = 0;
13478 const char *__pyx_filename = NULL;
13479 int __pyx_clineno = 0;
13480 __Pyx_RefNannySetupContext(
"__setitem__", 0);
13481 __Pyx_TraceCall(
"__setitem__", __pyx_f[1], 418, 0, __PYX_ERR(1, 418, __pyx_L1_error));
13482 __Pyx_INCREF(__pyx_v_index);
13491 __Pyx_TraceLine(419,0,__PYX_ERR(1, 419, __pyx_L1_error))
13492 __pyx_t_1 = (__pyx_v_self->view.readonly != 0);
13493 if (unlikely(__pyx_t_1)) {
13502 __Pyx_TraceLine(420,0,__PYX_ERR(1, 420, __pyx_L1_error))
13503 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__15, NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 420, __pyx_L1_error)
13504 __Pyx_GOTREF(__pyx_t_2);
13505 __Pyx_Raise(__pyx_t_2, 0, 0, 0);
13506 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13507 __PYX_ERR(1, 420, __pyx_L1_error)
13525 __Pyx_TraceLine(422,0,__PYX_ERR(1, 422, __pyx_L1_error))
13526 __pyx_t_2 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 422, __pyx_L1_error)
13527 __Pyx_GOTREF(__pyx_t_2);
13528 if (likely(__pyx_t_2 != Py_None)) {
13529 PyObject* sequence = __pyx_t_2;
13530 Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
13531 if (unlikely(size != 2)) {
13532 if (size > 2) __Pyx_RaiseTooManyValuesError(2);
13533 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
13534 __PYX_ERR(1, 422, __pyx_L1_error)
13536 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
13537 __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0);
13538 __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
13539 __Pyx_INCREF(__pyx_t_3);
13540 __Pyx_INCREF(__pyx_t_4);
13542 __pyx_t_3 = PySequence_ITEM(sequence, 0);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 422, __pyx_L1_error)
13543 __Pyx_GOTREF(__pyx_t_3);
13544 __pyx_t_4 = PySequence_ITEM(sequence, 1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 422, __pyx_L1_error)
13545 __Pyx_GOTREF(__pyx_t_4);
13547 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13549 __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 422, __pyx_L1_error)
13551 __pyx_v_have_slices = __pyx_t_3;
13553 __Pyx_DECREF_SET(__pyx_v_index, __pyx_t_4);
13563 __Pyx_TraceLine(424,0,__PYX_ERR(1, 424, __pyx_L1_error))
13564 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices);
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 424, __pyx_L1_error)
13574 __Pyx_TraceLine(425,0,__PYX_ERR(1, 425, __pyx_L1_error))
13575 __pyx_t_2 = ((
struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->is_slice(__pyx_v_self, __pyx_v_value);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 425, __pyx_L1_error)
13576 __Pyx_GOTREF(__pyx_t_2);
13577 __pyx_v_obj = __pyx_t_2;
13587 __Pyx_TraceLine(426,0,__PYX_ERR(1, 426, __pyx_L1_error))
13588 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_obj);
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 426, __pyx_L1_error)
13598 __Pyx_TraceLine(427,0,__PYX_ERR(1, 427, __pyx_L1_error))
13599 __pyx_t_2 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 427, __pyx_L1_error)
13600 __Pyx_GOTREF(__pyx_t_2);
13601 __pyx_t_4 = ((
struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assignment(__pyx_v_self, __pyx_t_2, __pyx_v_obj);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 427, __pyx_L1_error)
13602 __Pyx_GOTREF(__pyx_t_4);
13603 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13604 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
13623 __Pyx_TraceLine(429,0,__PYX_ERR(1, 429, __pyx_L1_error))
13625 __pyx_t_4 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 429, __pyx_L1_error)
13626 __Pyx_GOTREF(__pyx_t_4);
13627 if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_memoryview_type))))) __PYX_ERR(1, 429, __pyx_L1_error)
13628 __pyx_t_2 = ((
struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assign_scalar(__pyx_v_self, ((
struct __pyx_memoryview_obj *)__pyx_t_4), __pyx_v_value);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 429, __pyx_L1_error)
13629 __Pyx_GOTREF(__pyx_t_2);
13630 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
13631 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13652 __Pyx_TraceLine(431,0,__PYX_ERR(1, 431, __pyx_L1_error))
13654 __pyx_t_2 = ((
struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_indexed(__pyx_v_self, __pyx_v_index, __pyx_v_value);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 431, __pyx_L1_error)
13655 __Pyx_GOTREF(__pyx_t_2);
13656 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13672 __Pyx_XDECREF(__pyx_t_2);
13673 __Pyx_XDECREF(__pyx_t_3);
13674 __Pyx_XDECREF(__pyx_t_4);
13675 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13678 __Pyx_XDECREF(__pyx_v_have_slices);
13679 __Pyx_XDECREF(__pyx_v_obj);
13680 __Pyx_XDECREF(__pyx_v_index);
13681 __Pyx_TraceReturn(Py_None, 0);
13682 __Pyx_RefNannyFinishContext();
13694 static PyObject *__pyx_memoryview_is_slice(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj) {
13695 PyObject *__pyx_r = NULL;
13696 __Pyx_TraceDeclarations
13697 __Pyx_RefNannyDeclarations
13700 PyObject *__pyx_t_3 = NULL;
13701 PyObject *__pyx_t_4 = NULL;
13702 PyObject *__pyx_t_5 = NULL;
13703 PyObject *__pyx_t_6 = NULL;
13704 PyObject *__pyx_t_7 = NULL;
13705 PyObject *__pyx_t_8 = NULL;
13707 int __pyx_lineno = 0;
13708 const char *__pyx_filename = NULL;
13709 int __pyx_clineno = 0;
13710 __Pyx_RefNannySetupContext(
"is_slice", 0);
13711 __Pyx_TraceCall(
"is_slice", __pyx_f[1], 433, 0, __PYX_ERR(1, 433, __pyx_L1_error));
13712 __Pyx_INCREF(__pyx_v_obj);
13721 __Pyx_TraceLine(434,0,__PYX_ERR(1, 434, __pyx_L1_error))
13722 __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_obj, __pyx_memoryview_type);
13723 __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
13733 __Pyx_TraceLine(435,0,__PYX_ERR(1, 435, __pyx_L1_error))
13735 __Pyx_PyThreadState_declare
13736 __Pyx_PyThreadState_assign
13737 __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
13738 __Pyx_XGOTREF(__pyx_t_3);
13739 __Pyx_XGOTREF(__pyx_t_4);
13740 __Pyx_XGOTREF(__pyx_t_5);
13750 __Pyx_TraceLine(436,0,__PYX_ERR(1, 436, __pyx_L4_error))
13751 __pyx_t_6 = __Pyx_PyInt_From_int(((__pyx_v_self->flags & (~PyBUF_WRITABLE)) | PyBUF_ANY_CONTIGUOUS));
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 436, __pyx_L4_error)
13752 __Pyx_GOTREF(__pyx_t_6);
13761 __Pyx_TraceLine(437,0,__PYX_ERR(1, 437, __pyx_L4_error))
13762 __pyx_t_7 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object);
if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 437, __pyx_L4_error)
13763 __Pyx_GOTREF(__pyx_t_7);
13772 __Pyx_TraceLine(436,0,__PYX_ERR(1, 436, __pyx_L4_error))
13773 __pyx_t_8 = PyTuple_New(3);
if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 436, __pyx_L4_error)
13774 __Pyx_GOTREF(__pyx_t_8);
13775 __Pyx_INCREF(__pyx_v_obj);
13776 __Pyx_GIVEREF(__pyx_v_obj);
13777 PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_obj);
13778 __Pyx_GIVEREF(__pyx_t_6);
13779 PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_6);
13780 __Pyx_GIVEREF(__pyx_t_7);
13781 PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_7);
13784 __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_8, NULL);
if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 436, __pyx_L4_error)
13785 __Pyx_GOTREF(__pyx_t_7);
13786 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
13787 __Pyx_DECREF_SET(__pyx_v_obj, __pyx_t_7);
13798 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
13799 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
13800 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
13801 goto __pyx_L9_try_end;
13803 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
13804 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
13805 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
13814 __Pyx_TraceLine(438,0,__PYX_ERR(1, 438, __pyx_L6_except_error))
13815 __pyx_t_9 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError);
13817 __Pyx_AddTraceback(
"View.MemoryView.memoryview.is_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
13818 if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_8, &__pyx_t_6) < 0) __PYX_ERR(1, 438, __pyx_L6_except_error)
13819 __Pyx_GOTREF(__pyx_t_7);
13820 __Pyx_GOTREF(__pyx_t_8);
13821 __Pyx_GOTREF(__pyx_t_6);
13830 __Pyx_TraceLine(439,0,__PYX_ERR(1, 439, __pyx_L6_except_error))
13831 __Pyx_XDECREF(__pyx_r);
13832 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
13833 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
13834 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
13835 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
13836 goto __pyx_L7_except_return;
13838 goto __pyx_L6_except_error;
13839 __pyx_L6_except_error:;
13848 __Pyx_XGIVEREF(__pyx_t_3);
13849 __Pyx_XGIVEREF(__pyx_t_4);
13850 __Pyx_XGIVEREF(__pyx_t_5);
13851 __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
13852 goto __pyx_L1_error;
13853 __pyx_L7_except_return:;
13854 __Pyx_XGIVEREF(__pyx_t_3);
13855 __Pyx_XGIVEREF(__pyx_t_4);
13856 __Pyx_XGIVEREF(__pyx_t_5);
13857 __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
13878 __Pyx_TraceLine(441,0,__PYX_ERR(1, 441, __pyx_L1_error))
13879 __Pyx_XDECREF(__pyx_r);
13880 __Pyx_INCREF(__pyx_v_obj);
13881 __pyx_r = __pyx_v_obj;
13894 __Pyx_XDECREF(__pyx_t_6);
13895 __Pyx_XDECREF(__pyx_t_7);
13896 __Pyx_XDECREF(__pyx_t_8);
13897 __Pyx_AddTraceback(
"View.MemoryView.memoryview.is_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
13900 __Pyx_XDECREF(__pyx_v_obj);
13901 __Pyx_XGIVEREF(__pyx_r);
13902 __Pyx_TraceReturn(__pyx_r, 0);
13903 __Pyx_RefNannyFinishContext();
13915 static PyObject *__pyx_memoryview_setitem_slice_assignment(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_dst, PyObject *__pyx_v_src) {
13916 __Pyx_memviewslice __pyx_v_dst_slice;
13917 __Pyx_memviewslice __pyx_v_src_slice;
13918 PyObject *__pyx_r = NULL;
13919 __Pyx_TraceDeclarations
13920 __Pyx_RefNannyDeclarations
13921 __Pyx_memviewslice *__pyx_t_1;
13922 __Pyx_memviewslice *__pyx_t_2;
13923 PyObject *__pyx_t_3 = NULL;
13927 int __pyx_lineno = 0;
13928 const char *__pyx_filename = NULL;
13929 int __pyx_clineno = 0;
13930 __Pyx_RefNannySetupContext(
"setitem_slice_assignment", 0);
13931 __Pyx_TraceCall(
"setitem_slice_assignment", __pyx_f[1], 443, 0, __PYX_ERR(1, 443, __pyx_L1_error));
13940 __Pyx_TraceLine(447,0,__PYX_ERR(1, 447, __pyx_L1_error))
13941 if (!(likely(((__pyx_v_src) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_src, __pyx_memoryview_type))))) __PYX_ERR(1, 447, __pyx_L1_error)
13942 __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(((
struct __pyx_memoryview_obj *)__pyx_v_src), (&__pyx_v_src_slice));
if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(1, 447, __pyx_L1_error)
13951 __Pyx_TraceLine(448,0,__PYX_ERR(1, 448, __pyx_L1_error))
13952 if (!(likely(((__pyx_v_dst) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_dst, __pyx_memoryview_type))))) __PYX_ERR(1, 448, __pyx_L1_error)
13953 __pyx_t_2 = __pyx_memoryview_get_slice_from_memoryview(((
struct __pyx_memoryview_obj *)__pyx_v_dst), (&__pyx_v_dst_slice));
if (unlikely(__pyx_t_2 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(1, 448, __pyx_L1_error)
13962 __Pyx_TraceLine(449,0,__PYX_ERR(1, 449, __pyx_L1_error))
13963 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_src, __pyx_n_s_ndim);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 449, __pyx_L1_error)
13964 __Pyx_GOTREF(__pyx_t_3);
13965 __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_3);
if (unlikely((__pyx_t_4 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(1, 449, __pyx_L1_error)
13966 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13967 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_dst, __pyx_n_s_ndim);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 449, __pyx_L1_error)
13968 __Pyx_GOTREF(__pyx_t_3);
13969 __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_3);
if (unlikely((__pyx_t_5 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(1, 449, __pyx_L1_error)
13970 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13979 __Pyx_TraceLine(447,0,__PYX_ERR(1, 447, __pyx_L1_error))
13980 __pyx_t_6 = __pyx_memoryview_copy_contents((__pyx_t_1[0]), (__pyx_t_2[0]), __pyx_t_4, __pyx_t_5, __pyx_v_self->dtype_is_object);
if (unlikely(__pyx_t_6 == ((
int)-1))) __PYX_ERR(1, 447, __pyx_L1_error)
13991 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
13994 __Pyx_XDECREF(__pyx_t_3);
13995 __Pyx_AddTraceback(
"View.MemoryView.memoryview.setitem_slice_assignment", __pyx_clineno, __pyx_lineno, __pyx_filename);
13998 __Pyx_XGIVEREF(__pyx_r);
13999 __Pyx_TraceReturn(__pyx_r, 0);
14000 __Pyx_RefNannyFinishContext();
14012 static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(
struct __pyx_memoryview_obj *__pyx_v_self,
struct __pyx_memoryview_obj *__pyx_v_dst, PyObject *__pyx_v_value) {
14013 int __pyx_v_array[0x80];
14015 void *__pyx_v_item;
14016 __Pyx_memviewslice *__pyx_v_dst_slice;
14017 __Pyx_memviewslice __pyx_v_tmp_slice;
14018 PyObject *__pyx_r = NULL;
14019 __Pyx_TraceDeclarations
14020 __Pyx_RefNannyDeclarations
14021 __Pyx_memviewslice *__pyx_t_1;
14023 PyObject *__pyx_t_3 = NULL;
14026 char const *__pyx_t_6;
14027 PyObject *__pyx_t_7 = NULL;
14028 PyObject *__pyx_t_8 = NULL;
14029 PyObject *__pyx_t_9 = NULL;
14030 PyObject *__pyx_t_10 = NULL;
14031 PyObject *__pyx_t_11 = NULL;
14032 PyObject *__pyx_t_12 = NULL;
14033 int __pyx_lineno = 0;
14034 const char *__pyx_filename = NULL;
14035 int __pyx_clineno = 0;
14036 __Pyx_RefNannySetupContext(
"setitem_slice_assign_scalar", 0);
14037 __Pyx_TraceCall(
"setitem_slice_assign_scalar", __pyx_f[1], 451, 0, __PYX_ERR(1, 451, __pyx_L1_error));
14046 __Pyx_TraceLine(453,0,__PYX_ERR(1, 453, __pyx_L1_error))
14047 __pyx_v_tmp = NULL;
14056 __Pyx_TraceLine(458,0,__PYX_ERR(1, 458, __pyx_L1_error))
14057 __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_dst, (&__pyx_v_tmp_slice));
if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(1, 458, __pyx_L1_error)
14058 __pyx_v_dst_slice = __pyx_t_1;
14067 __Pyx_TraceLine(460,0,__PYX_ERR(1, 460, __pyx_L1_error))
14068 __pyx_t_2 = ((((size_t)__pyx_v_self->view.itemsize) > (
sizeof(__pyx_v_array))) != 0);
14078 __Pyx_TraceLine(461,0,__PYX_ERR(1, 461, __pyx_L1_error))
14079 __pyx_v_tmp = PyMem_Malloc(__pyx_v_self->view.itemsize);
14088 __Pyx_TraceLine(462,0,__PYX_ERR(1, 462, __pyx_L1_error))
14089 __pyx_t_2 = ((__pyx_v_tmp == NULL) != 0);
14090 if (unlikely(__pyx_t_2)) {
14099 __Pyx_TraceLine(463,0,__PYX_ERR(1, 463, __pyx_L1_error))
14100 PyErr_NoMemory(); __PYX_ERR(1, 463, __pyx_L1_error)
14118 __Pyx_TraceLine(464,0,__PYX_ERR(1, 464, __pyx_L1_error))
14119 __pyx_v_item = __pyx_v_tmp;
14138 __Pyx_TraceLine(466,0,__PYX_ERR(1, 466, __pyx_L1_error))
14140 __pyx_v_item = ((
void *)__pyx_v_array);
14151 __Pyx_TraceLine(468,0,__PYX_ERR(1, 468, __pyx_L1_error))
14161 __Pyx_TraceLine(469,0,__PYX_ERR(1, 469, __pyx_L6_error))
14162 __pyx_t_2 = (__pyx_v_self->dtype_is_object != 0);
14172 __Pyx_TraceLine(470,0,__PYX_ERR(1, 470, __pyx_L6_error))
14173 (((PyObject **)__pyx_v_item)[0]) = ((PyObject *)__pyx_v_value);
14192 __Pyx_TraceLine(472,0,__PYX_ERR(1, 472, __pyx_L6_error))
14194 __pyx_t_3 = ((
struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->assign_item_from_object(__pyx_v_self, ((
char *)__pyx_v_item), __pyx_v_value);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 472, __pyx_L6_error)
14195 __Pyx_GOTREF(__pyx_t_3);
14196 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14207 __Pyx_TraceLine(476,0,__PYX_ERR(1, 476, __pyx_L6_error))
14208 __pyx_t_2 = ((__pyx_v_self->view.suboffsets != NULL) != 0);
14218 __Pyx_TraceLine(477,0,__PYX_ERR(1, 477, __pyx_L6_error))
14219 __pyx_t_3 = assert_direct_dimensions(__pyx_v_self->view.suboffsets, __pyx_v_self->view.ndim);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 477, __pyx_L6_error)
14220 __Pyx_GOTREF(__pyx_t_3);
14221 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14239 __Pyx_TraceLine(478,0,__PYX_ERR(1, 478, __pyx_L6_error))
14240 __pyx_memoryview_slice_assign_scalar(__pyx_v_dst_slice, __pyx_v_dst->view.ndim, __pyx_v_self->view.itemsize, __pyx_v_item, __pyx_v_self->dtype_is_object);
14250 __Pyx_TraceLine(481,0,__PYX_ERR(1, 481, __pyx_L6_error))
14253 PyMem_Free(__pyx_v_tmp);
14258 __Pyx_PyThreadState_declare
14259 __Pyx_PyThreadState_assign
14260 __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0;
14261 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
14262 if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12);
14263 if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9) < 0)) __Pyx_ErrFetch(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9);
14264 __Pyx_XGOTREF(__pyx_t_7);
14265 __Pyx_XGOTREF(__pyx_t_8);
14266 __Pyx_XGOTREF(__pyx_t_9);
14267 __Pyx_XGOTREF(__pyx_t_10);
14268 __Pyx_XGOTREF(__pyx_t_11);
14269 __Pyx_XGOTREF(__pyx_t_12);
14270 __pyx_t_4 = __pyx_lineno; __pyx_t_5 = __pyx_clineno; __pyx_t_6 = __pyx_filename;
14272 PyMem_Free(__pyx_v_tmp);
14274 if (PY_MAJOR_VERSION >= 3) {
14275 __Pyx_XGIVEREF(__pyx_t_10);
14276 __Pyx_XGIVEREF(__pyx_t_11);
14277 __Pyx_XGIVEREF(__pyx_t_12);
14278 __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12);
14280 __Pyx_XGIVEREF(__pyx_t_7);
14281 __Pyx_XGIVEREF(__pyx_t_8);
14282 __Pyx_XGIVEREF(__pyx_t_9);
14283 __Pyx_ErrRestore(__pyx_t_7, __pyx_t_8, __pyx_t_9);
14284 __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0;
14285 __pyx_lineno = __pyx_t_4; __pyx_clineno = __pyx_t_5; __pyx_filename = __pyx_t_6;
14286 goto __pyx_L1_error;
14300 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
14303 __Pyx_XDECREF(__pyx_t_3);
14304 __Pyx_AddTraceback(
"View.MemoryView.memoryview.setitem_slice_assign_scalar", __pyx_clineno, __pyx_lineno, __pyx_filename);
14307 __Pyx_XGIVEREF(__pyx_r);
14308 __Pyx_TraceReturn(__pyx_r, 0);
14309 __Pyx_RefNannyFinishContext();
14321 static PyObject *__pyx_memoryview_setitem_indexed(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
14322 char *__pyx_v_itemp;
14323 PyObject *__pyx_r = NULL;
14324 __Pyx_TraceDeclarations
14325 __Pyx_RefNannyDeclarations
14327 PyObject *__pyx_t_2 = NULL;
14328 int __pyx_lineno = 0;
14329 const char *__pyx_filename = NULL;
14330 int __pyx_clineno = 0;
14331 __Pyx_RefNannySetupContext(
"setitem_indexed", 0);
14332 __Pyx_TraceCall(
"setitem_indexed", __pyx_f[1], 483, 0, __PYX_ERR(1, 483, __pyx_L1_error));
14341 __Pyx_TraceLine(484,0,__PYX_ERR(1, 484, __pyx_L1_error))
14342 __pyx_t_1 = ((
struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_index);
if (unlikely(__pyx_t_1 == ((
char *)NULL))) __PYX_ERR(1, 484, __pyx_L1_error)
14343 __pyx_v_itemp = __pyx_t_1;
14352 __Pyx_TraceLine(485,0,__PYX_ERR(1, 485, __pyx_L1_error))
14353 __pyx_t_2 = ((
struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->assign_item_from_object(__pyx_v_self, __pyx_v_itemp, __pyx_v_value);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 485, __pyx_L1_error)
14354 __Pyx_GOTREF(__pyx_t_2);
14355 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14366 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
14369 __Pyx_XDECREF(__pyx_t_2);
14370 __Pyx_AddTraceback(
"View.MemoryView.memoryview.setitem_indexed", __pyx_clineno, __pyx_lineno, __pyx_filename);
14373 __Pyx_XGIVEREF(__pyx_r);
14374 __Pyx_TraceReturn(__pyx_r, 0);
14375 __Pyx_RefNannyFinishContext();
14387 static PyObject *__pyx_memoryview_convert_item_to_object(
struct __pyx_memoryview_obj *__pyx_v_self,
char *__pyx_v_itemp) {
14388 PyObject *__pyx_v_struct = NULL;
14389 PyObject *__pyx_v_bytesitem = 0;
14390 PyObject *__pyx_v_result = NULL;
14391 PyObject *__pyx_r = NULL;
14392 __Pyx_TraceDeclarations
14393 __Pyx_RefNannyDeclarations
14394 PyObject *__pyx_t_1 = NULL;
14395 PyObject *__pyx_t_2 = NULL;
14396 PyObject *__pyx_t_3 = NULL;
14397 PyObject *__pyx_t_4 = NULL;
14398 PyObject *__pyx_t_5 = NULL;
14399 PyObject *__pyx_t_6 = NULL;
14400 PyObject *__pyx_t_7 = NULL;
14402 PyObject *__pyx_t_9 = NULL;
14405 int __pyx_lineno = 0;
14406 const char *__pyx_filename = NULL;
14407 int __pyx_clineno = 0;
14408 __Pyx_RefNannySetupContext(
"convert_item_to_object", 0);
14409 __Pyx_TraceCall(
"convert_item_to_object", __pyx_f[1], 487, 0, __PYX_ERR(1, 487, __pyx_L1_error));
14418 __Pyx_TraceLine(490,0,__PYX_ERR(1, 490, __pyx_L1_error))
14419 __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 490, __pyx_L1_error)
14420 __Pyx_GOTREF(__pyx_t_1);
14421 __pyx_v_struct = __pyx_t_1;
14431 __Pyx_TraceLine(493,0,__PYX_ERR(1, 493, __pyx_L1_error))
14432 __pyx_t_1 = __Pyx_PyBytes_FromStringAndSize(__pyx_v_itemp + 0, __pyx_v_self->view.itemsize - 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 493, __pyx_L1_error)
14433 __Pyx_GOTREF(__pyx_t_1);
14434 __pyx_v_bytesitem = ((PyObject*)__pyx_t_1);
14444 __Pyx_TraceLine(494,0,__PYX_ERR(1, 494, __pyx_L1_error))
14446 __Pyx_PyThreadState_declare
14447 __Pyx_PyThreadState_assign
14448 __Pyx_ExceptionSave(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4);
14449 __Pyx_XGOTREF(__pyx_t_2);
14450 __Pyx_XGOTREF(__pyx_t_3);
14451 __Pyx_XGOTREF(__pyx_t_4);
14461 __Pyx_TraceLine(495,0,__PYX_ERR(1, 495, __pyx_L3_error))
14462 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_unpack);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 495, __pyx_L3_error)
14463 __Pyx_GOTREF(__pyx_t_5);
14464 __pyx_t_6 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format);
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 495, __pyx_L3_error)
14465 __Pyx_GOTREF(__pyx_t_6);
14468 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
14469 __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
14470 if (likely(__pyx_t_7)) {
14471 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_5);
14472 __Pyx_INCREF(__pyx_t_7);
14473 __Pyx_INCREF(
function);
14474 __Pyx_DECREF_SET(__pyx_t_5,
function);
14478 #if CYTHON_FAST_PYCALL
14479 if (PyFunction_Check(__pyx_t_5)) {
14480 PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_6, __pyx_v_bytesitem};
14481 __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 495, __pyx_L3_error)
14482 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
14483 __Pyx_GOTREF(__pyx_t_1);
14484 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
14487 #if CYTHON_FAST_PYCCALL
14488 if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
14489 PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_6, __pyx_v_bytesitem};
14490 __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 495, __pyx_L3_error)
14491 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
14492 __Pyx_GOTREF(__pyx_t_1);
14493 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
14497 __pyx_t_9 = PyTuple_New(2+__pyx_t_8);
if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 495, __pyx_L3_error)
14498 __Pyx_GOTREF(__pyx_t_9);
14500 __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL;
14502 __Pyx_GIVEREF(__pyx_t_6);
14503 PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_t_6);
14504 __Pyx_INCREF(__pyx_v_bytesitem);
14505 __Pyx_GIVEREF(__pyx_v_bytesitem);
14506 PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_v_bytesitem);
14508 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_9, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 495, __pyx_L3_error)
14509 __Pyx_GOTREF(__pyx_t_1);
14510 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
14512 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
14513 __pyx_v_result = __pyx_t_1;
14532 __Pyx_TraceLine(499,0,__PYX_ERR(1, 499, __pyx_L5_except_error))
14534 __pyx_t_10 = strlen(__pyx_v_self->view.format);
14535 __pyx_t_11 = ((__pyx_t_10 == 1) != 0);
14545 __Pyx_TraceLine(500,0,__PYX_ERR(1, 500, __pyx_L5_except_error))
14546 __Pyx_XDECREF(__pyx_r);
14547 __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_result, 0,
long, 1, __Pyx_PyInt_From_long, 0, 0, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 500, __pyx_L5_except_error)
14548 __Pyx_GOTREF(__pyx_t_1);
14549 __pyx_r = __pyx_t_1;
14551 goto __pyx_L6_except_return;
14569 __Pyx_TraceLine(501,0,__PYX_ERR(1, 501, __pyx_L5_except_error))
14570 __Pyx_XDECREF(__pyx_r);
14571 __Pyx_INCREF(__pyx_v_result);
14572 __pyx_r = __pyx_v_result;
14573 goto __pyx_L6_except_return;
14576 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
14577 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
14578 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
14579 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
14580 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
14589 __Pyx_TraceLine(496,0,__PYX_ERR(1, 496, __pyx_L5_except_error))
14590 __Pyx_ErrFetch(&__pyx_t_1, &__pyx_t_5, &__pyx_t_9);
14591 __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_error);
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 496, __pyx_L5_except_error)
14592 __Pyx_GOTREF(__pyx_t_6);
14593 __pyx_t_8 = __Pyx_PyErr_GivenExceptionMatches(__pyx_t_1, __pyx_t_6);
14594 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
14595 __Pyx_ErrRestore(__pyx_t_1, __pyx_t_5, __pyx_t_9);
14596 __pyx_t_1 = 0; __pyx_t_5 = 0; __pyx_t_9 = 0;
14598 __Pyx_AddTraceback(
"View.MemoryView.memoryview.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
14599 if (__Pyx_GetException(&__pyx_t_9, &__pyx_t_5, &__pyx_t_1) < 0) __PYX_ERR(1, 496, __pyx_L5_except_error)
14600 __Pyx_GOTREF(__pyx_t_9);
14601 __Pyx_GOTREF(__pyx_t_5);
14602 __Pyx_GOTREF(__pyx_t_1);
14611 __Pyx_TraceLine(497,0,__PYX_ERR(1, 497, __pyx_L5_except_error))
14612 __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__16, NULL);
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 497, __pyx_L5_except_error)
14613 __Pyx_GOTREF(__pyx_t_6);
14614 __Pyx_Raise(__pyx_t_6, 0, 0, 0);
14615 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
14616 __PYX_ERR(1, 497, __pyx_L5_except_error)
14618 goto __pyx_L5_except_error;
14619 __pyx_L5_except_error:;
14628 __Pyx_XGIVEREF(__pyx_t_2);
14629 __Pyx_XGIVEREF(__pyx_t_3);
14630 __Pyx_XGIVEREF(__pyx_t_4);
14631 __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
14632 goto __pyx_L1_error;
14633 __pyx_L6_except_return:;
14634 __Pyx_XGIVEREF(__pyx_t_2);
14635 __Pyx_XGIVEREF(__pyx_t_3);
14636 __Pyx_XGIVEREF(__pyx_t_4);
14637 __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
14651 __Pyx_XDECREF(__pyx_t_1);
14652 __Pyx_XDECREF(__pyx_t_5);
14653 __Pyx_XDECREF(__pyx_t_6);
14654 __Pyx_XDECREF(__pyx_t_7);
14655 __Pyx_XDECREF(__pyx_t_9);
14656 __Pyx_AddTraceback(
"View.MemoryView.memoryview.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
14659 __Pyx_XDECREF(__pyx_v_struct);
14660 __Pyx_XDECREF(__pyx_v_bytesitem);
14661 __Pyx_XDECREF(__pyx_v_result);
14662 __Pyx_XGIVEREF(__pyx_r);
14663 __Pyx_TraceReturn(__pyx_r, 0);
14664 __Pyx_RefNannyFinishContext();
14676 static PyObject *__pyx_memoryview_assign_item_from_object(
struct __pyx_memoryview_obj *__pyx_v_self,
char *__pyx_v_itemp, PyObject *__pyx_v_value) {
14677 PyObject *__pyx_v_struct = NULL;
14679 PyObject *__pyx_v_bytesvalue = 0;
14680 Py_ssize_t __pyx_v_i;
14681 PyObject *__pyx_r = NULL;
14682 __Pyx_TraceDeclarations
14683 __Pyx_RefNannyDeclarations
14684 PyObject *__pyx_t_1 = NULL;
14687 PyObject *__pyx_t_4 = NULL;
14688 PyObject *__pyx_t_5 = NULL;
14689 PyObject *__pyx_t_6 = NULL;
14691 PyObject *__pyx_t_8 = NULL;
14692 Py_ssize_t __pyx_t_9;
14693 PyObject *__pyx_t_10 = NULL;
14698 int __pyx_lineno = 0;
14699 const char *__pyx_filename = NULL;
14700 int __pyx_clineno = 0;
14701 __Pyx_RefNannySetupContext(
"assign_item_from_object", 0);
14702 __Pyx_TraceCall(
"assign_item_from_object", __pyx_f[1], 503, 0, __PYX_ERR(1, 503, __pyx_L1_error));
14711 __Pyx_TraceLine(506,0,__PYX_ERR(1, 506, __pyx_L1_error))
14712 __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 506, __pyx_L1_error)
14713 __Pyx_GOTREF(__pyx_t_1);
14714 __pyx_v_struct = __pyx_t_1;
14724 __Pyx_TraceLine(511,0,__PYX_ERR(1, 511, __pyx_L1_error))
14725 __pyx_t_2 = PyTuple_Check(__pyx_v_value);
14726 __pyx_t_3 = (__pyx_t_2 != 0);
14736 __Pyx_TraceLine(512,0,__PYX_ERR(1, 512, __pyx_L1_error))
14737 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 512, __pyx_L1_error)
14738 __Pyx_GOTREF(__pyx_t_1);
14739 __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 512, __pyx_L1_error)
14740 __Pyx_GOTREF(__pyx_t_4);
14741 __pyx_t_5 = PyTuple_New(1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 512, __pyx_L1_error)
14742 __Pyx_GOTREF(__pyx_t_5);
14743 __Pyx_GIVEREF(__pyx_t_4);
14744 PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
14746 __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_v_value);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 512, __pyx_L1_error)
14747 __Pyx_GOTREF(__pyx_t_4);
14748 __pyx_t_6 = PyNumber_Add(__pyx_t_5, __pyx_t_4);
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 512, __pyx_L1_error)
14749 __Pyx_GOTREF(__pyx_t_6);
14750 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
14751 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
14752 __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 512, __pyx_L1_error)
14753 __Pyx_GOTREF(__pyx_t_4);
14754 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14755 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
14756 if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||((
void)PyErr_Format(PyExc_TypeError,
"Expected %.16s, got %.200s",
"bytes", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(1, 512, __pyx_L1_error)
14757 __pyx_v_bytesvalue = ((PyObject*)__pyx_t_4);
14777 __Pyx_TraceLine(514,0,__PYX_ERR(1, 514, __pyx_L1_error))
14779 __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack);
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 514, __pyx_L1_error)
14780 __Pyx_GOTREF(__pyx_t_6);
14781 __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 514, __pyx_L1_error)
14782 __Pyx_GOTREF(__pyx_t_1);
14785 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
14786 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
14787 if (likely(__pyx_t_5)) {
14788 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_6);
14789 __Pyx_INCREF(__pyx_t_5);
14790 __Pyx_INCREF(
function);
14791 __Pyx_DECREF_SET(__pyx_t_6,
function);
14795 #if CYTHON_FAST_PYCALL
14796 if (PyFunction_Check(__pyx_t_6)) {
14797 PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_1, __pyx_v_value};
14798 __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 514, __pyx_L1_error)
14799 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
14800 __Pyx_GOTREF(__pyx_t_4);
14801 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14804 #if CYTHON_FAST_PYCCALL
14805 if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
14806 PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_1, __pyx_v_value};
14807 __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 514, __pyx_L1_error)
14808 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
14809 __Pyx_GOTREF(__pyx_t_4);
14810 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14814 __pyx_t_8 = PyTuple_New(2+__pyx_t_7);
if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 514, __pyx_L1_error)
14815 __Pyx_GOTREF(__pyx_t_8);
14817 __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5); __pyx_t_5 = NULL;
14819 __Pyx_GIVEREF(__pyx_t_1);
14820 PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_t_1);
14821 __Pyx_INCREF(__pyx_v_value);
14822 __Pyx_GIVEREF(__pyx_v_value);
14823 PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_v_value);
14825 __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 514, __pyx_L1_error)
14826 __Pyx_GOTREF(__pyx_t_4);
14827 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
14829 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
14830 if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||((
void)PyErr_Format(PyExc_TypeError,
"Expected %.16s, got %.200s",
"bytes", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(1, 514, __pyx_L1_error)
14831 __pyx_v_bytesvalue = ((PyObject*)__pyx_t_4);
14843 __Pyx_TraceLine(516,0,__PYX_ERR(1, 516, __pyx_L1_error))
14845 if (unlikely(__pyx_v_bytesvalue == Py_None)) {
14846 PyErr_SetString(PyExc_TypeError,
"'NoneType' is not iterable");
14847 __PYX_ERR(1, 516, __pyx_L1_error)
14849 __Pyx_INCREF(__pyx_v_bytesvalue);
14850 __pyx_t_10 = __pyx_v_bytesvalue;
14851 __pyx_t_12 = PyBytes_AS_STRING(__pyx_t_10);
14852 __pyx_t_13 = (__pyx_t_12 + PyBytes_GET_SIZE(__pyx_t_10));
14853 for (__pyx_t_14 = __pyx_t_12; __pyx_t_14 < __pyx_t_13; __pyx_t_14++) {
14854 __pyx_t_11 = __pyx_t_14;
14855 __pyx_v_c = (__pyx_t_11[0]);
14864 __Pyx_TraceLine(517,0,__PYX_ERR(1, 517, __pyx_L1_error))
14865 __pyx_v_i = __pyx_t_9;
14874 __Pyx_TraceLine(516,0,__PYX_ERR(1, 516, __pyx_L1_error))
14875 __pyx_t_9 = (__pyx_t_9 + 1);
14884 __Pyx_TraceLine(517,0,__PYX_ERR(1, 517, __pyx_L1_error))
14885 (__pyx_v_itemp[__pyx_v_i]) = __pyx_v_c;
14887 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
14898 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
14901 __Pyx_XDECREF(__pyx_t_1);
14902 __Pyx_XDECREF(__pyx_t_4);
14903 __Pyx_XDECREF(__pyx_t_5);
14904 __Pyx_XDECREF(__pyx_t_6);
14905 __Pyx_XDECREF(__pyx_t_8);
14906 __Pyx_XDECREF(__pyx_t_10);
14907 __Pyx_AddTraceback(
"View.MemoryView.memoryview.assign_item_from_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
14910 __Pyx_XDECREF(__pyx_v_struct);
14911 __Pyx_XDECREF(__pyx_v_bytesvalue);
14912 __Pyx_XGIVEREF(__pyx_r);
14913 __Pyx_TraceReturn(__pyx_r, 0);
14914 __Pyx_RefNannyFinishContext();
14927 static CYTHON_UNUSED
int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags);
14928 static CYTHON_UNUSED
int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags) {
14930 __Pyx_RefNannyDeclarations
14931 __Pyx_RefNannySetupContext(
"__getbuffer__ (wrapper)", 0);
14932 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(((
struct __pyx_memoryview_obj *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((
int)__pyx_v_flags));
14935 __Pyx_RefNannyFinishContext();
14939 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(
struct __pyx_memoryview_obj *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags) {
14941 __Pyx_TraceDeclarations
14942 __Pyx_RefNannyDeclarations
14945 PyObject *__pyx_t_3 = NULL;
14946 Py_ssize_t *__pyx_t_4;
14950 Py_ssize_t __pyx_t_8;
14951 int __pyx_lineno = 0;
14952 const char *__pyx_filename = NULL;
14953 int __pyx_clineno = 0;
14954 if (__pyx_v_info == NULL) {
14955 PyErr_SetString(PyExc_BufferError,
"PyObject_GetBuffer: view==NULL argument is obsolete");
14958 __Pyx_RefNannySetupContext(
"__getbuffer__", 0);
14959 __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
14960 __Pyx_GIVEREF(__pyx_v_info->obj);
14961 __Pyx_TraceCall(
"__getbuffer__", __pyx_f[1], 520, 0, __PYX_ERR(1, 520, __pyx_L1_error));
14970 __Pyx_TraceLine(521,0,__PYX_ERR(1, 521, __pyx_L1_error))
14971 __pyx_t_2 = ((__pyx_v_flags & PyBUF_WRITABLE) != 0);
14974 __pyx_t_1 = __pyx_t_2;
14975 goto __pyx_L4_bool_binop_done;
14977 __pyx_t_2 = (__pyx_v_self->view.readonly != 0);
14978 __pyx_t_1 = __pyx_t_2;
14979 __pyx_L4_bool_binop_done:;
14980 if (unlikely(__pyx_t_1)) {
14989 __Pyx_TraceLine(522,0,__PYX_ERR(1, 522, __pyx_L1_error))
14990 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__17, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 522, __pyx_L1_error)
14991 __Pyx_GOTREF(__pyx_t_3);
14992 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
14993 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14994 __PYX_ERR(1, 522, __pyx_L1_error)
15012 __Pyx_TraceLine(524,0,__PYX_ERR(1, 524, __pyx_L1_error))
15013 __pyx_t_1 = ((__pyx_v_flags & PyBUF_ND) != 0);
15023 __Pyx_TraceLine(525,0,__PYX_ERR(1, 525, __pyx_L1_error))
15024 __pyx_t_4 = __pyx_v_self->view.shape;
15025 __pyx_v_info->shape = __pyx_t_4;
15044 __Pyx_TraceLine(527,0,__PYX_ERR(1, 527, __pyx_L1_error))
15046 __pyx_v_info->shape = NULL;
15057 __Pyx_TraceLine(529,0,__PYX_ERR(1, 529, __pyx_L1_error))
15058 __pyx_t_1 = ((__pyx_v_flags & PyBUF_STRIDES) != 0);
15068 __Pyx_TraceLine(530,0,__PYX_ERR(1, 530, __pyx_L1_error))
15069 __pyx_t_4 = __pyx_v_self->view.strides;
15070 __pyx_v_info->strides = __pyx_t_4;
15089 __Pyx_TraceLine(532,0,__PYX_ERR(1, 532, __pyx_L1_error))
15091 __pyx_v_info->strides = NULL;
15102 __Pyx_TraceLine(534,0,__PYX_ERR(1, 534, __pyx_L1_error))
15103 __pyx_t_1 = ((__pyx_v_flags & PyBUF_INDIRECT) != 0);
15113 __Pyx_TraceLine(535,0,__PYX_ERR(1, 535, __pyx_L1_error))
15114 __pyx_t_4 = __pyx_v_self->view.suboffsets;
15115 __pyx_v_info->suboffsets = __pyx_t_4;
15134 __Pyx_TraceLine(537,0,__PYX_ERR(1, 537, __pyx_L1_error))
15136 __pyx_v_info->suboffsets = NULL;
15147 __Pyx_TraceLine(539,0,__PYX_ERR(1, 539, __pyx_L1_error))
15148 __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
15158 __Pyx_TraceLine(540,0,__PYX_ERR(1, 540, __pyx_L1_error))
15159 __pyx_t_5 = __pyx_v_self->view.format;
15160 __pyx_v_info->format = __pyx_t_5;
15179 __Pyx_TraceLine(542,0,__PYX_ERR(1, 542, __pyx_L1_error))
15181 __pyx_v_info->format = NULL;
15192 __Pyx_TraceLine(544,0,__PYX_ERR(1, 544, __pyx_L1_error))
15193 __pyx_t_6 = __pyx_v_self->view.buf;
15194 __pyx_v_info->buf = __pyx_t_6;
15203 __Pyx_TraceLine(545,0,__PYX_ERR(1, 545, __pyx_L1_error))
15204 __pyx_t_7 = __pyx_v_self->view.ndim;
15205 __pyx_v_info->ndim = __pyx_t_7;
15214 __Pyx_TraceLine(546,0,__PYX_ERR(1, 546, __pyx_L1_error))
15215 __pyx_t_8 = __pyx_v_self->view.itemsize;
15216 __pyx_v_info->itemsize = __pyx_t_8;
15225 __Pyx_TraceLine(547,0,__PYX_ERR(1, 547, __pyx_L1_error))
15226 __pyx_t_8 = __pyx_v_self->view.len;
15227 __pyx_v_info->len = __pyx_t_8;
15236 __Pyx_TraceLine(548,0,__PYX_ERR(1, 548, __pyx_L1_error))
15237 __pyx_t_1 = __pyx_v_self->view.readonly;
15238 __pyx_v_info->readonly = __pyx_t_1;
15247 __Pyx_TraceLine(549,0,__PYX_ERR(1, 549, __pyx_L1_error))
15248 __Pyx_INCREF(((PyObject *)__pyx_v_self));
15249 __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
15250 __Pyx_GOTREF(__pyx_v_info->obj);
15251 __Pyx_DECREF(__pyx_v_info->obj);
15252 __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
15266 __Pyx_XDECREF(__pyx_t_3);
15267 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
15269 if (__pyx_v_info->obj != NULL) {
15270 __Pyx_GOTREF(__pyx_v_info->obj);
15271 __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
15275 if (__pyx_v_info->obj == Py_None) {
15276 __Pyx_GOTREF(__pyx_v_info->obj);
15277 __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
15280 __Pyx_TraceReturn(Py_None, 0);
15281 __Pyx_RefNannyFinishContext();
15294 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(PyObject *__pyx_v_self);
15295 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(PyObject *__pyx_v_self) {
15296 PyObject *__pyx_r = 0;
15297 __Pyx_RefNannyDeclarations
15298 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
15299 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
15302 __Pyx_RefNannyFinishContext();
15306 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(
struct __pyx_memoryview_obj *__pyx_v_self) {
15307 struct __pyx_memoryviewslice_obj *__pyx_v_result = 0;
15308 PyObject *__pyx_r = NULL;
15309 __Pyx_TraceDeclarations
15310 __Pyx_RefNannyDeclarations
15311 PyObject *__pyx_t_1 = NULL;
15313 int __pyx_lineno = 0;
15314 const char *__pyx_filename = NULL;
15315 int __pyx_clineno = 0;
15316 __Pyx_RefNannySetupContext(
"__get__", 0);
15317 __Pyx_TraceCall(
"__get__", __pyx_f[1], 555, 0, __PYX_ERR(1, 555, __pyx_L1_error));
15326 __Pyx_TraceLine(556,0,__PYX_ERR(1, 556, __pyx_L1_error))
15327 __pyx_t_1 = __pyx_memoryview_copy_object(__pyx_v_self);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 556, __pyx_L1_error)
15328 __Pyx_GOTREF(__pyx_t_1);
15329 if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_memoryviewslice_type))))) __PYX_ERR(1, 556, __pyx_L1_error)
15330 __pyx_v_result = ((
struct __pyx_memoryviewslice_obj *)__pyx_t_1);
15340 __Pyx_TraceLine(557,0,__PYX_ERR(1, 557, __pyx_L1_error))
15341 __pyx_t_2 = __pyx_memslice_transpose((&__pyx_v_result->from_slice));
if (unlikely(__pyx_t_2 == ((
int)0))) __PYX_ERR(1, 557, __pyx_L1_error)
15350 __Pyx_TraceLine(558,0,__PYX_ERR(1, 558, __pyx_L1_error))
15351 __Pyx_XDECREF(__pyx_r);
15352 __Pyx_INCREF(((PyObject *)__pyx_v_result));
15353 __pyx_r = ((PyObject *)__pyx_v_result);
15366 __Pyx_XDECREF(__pyx_t_1);
15367 __Pyx_AddTraceback(
"View.MemoryView.memoryview.T.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
15370 __Pyx_XDECREF((PyObject *)__pyx_v_result);
15371 __Pyx_XGIVEREF(__pyx_r);
15372 __Pyx_TraceReturn(__pyx_r, 0);
15373 __Pyx_RefNannyFinishContext();
15386 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(PyObject *__pyx_v_self);
15387 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(PyObject *__pyx_v_self) {
15388 PyObject *__pyx_r = 0;
15389 __Pyx_RefNannyDeclarations
15390 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
15391 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
15394 __Pyx_RefNannyFinishContext();
15398 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(
struct __pyx_memoryview_obj *__pyx_v_self) {
15399 PyObject *__pyx_r = NULL;
15400 __Pyx_TraceDeclarations
15401 __Pyx_RefNannyDeclarations
15402 int __pyx_lineno = 0;
15403 const char *__pyx_filename = NULL;
15404 int __pyx_clineno = 0;
15405 __Pyx_RefNannySetupContext(
"__get__", 0);
15406 __Pyx_TraceCall(
"__get__", __pyx_f[1], 561, 0, __PYX_ERR(1, 561, __pyx_L1_error));
15415 __Pyx_TraceLine(562,0,__PYX_ERR(1, 562, __pyx_L1_error))
15416 __Pyx_XDECREF(__pyx_r);
15417 __Pyx_INCREF(__pyx_v_self->obj);
15418 __pyx_r = __pyx_v_self->obj;
15431 __Pyx_AddTraceback(
"View.MemoryView.memoryview.base.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
15434 __Pyx_XGIVEREF(__pyx_r);
15435 __Pyx_TraceReturn(__pyx_r, 0);
15436 __Pyx_RefNannyFinishContext();
15449 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(PyObject *__pyx_v_self);
15450 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(PyObject *__pyx_v_self) {
15451 PyObject *__pyx_r = 0;
15452 __Pyx_RefNannyDeclarations
15453 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
15454 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
15457 __Pyx_RefNannyFinishContext();
15461 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(
struct __pyx_memoryview_obj *__pyx_v_self) {
15462 Py_ssize_t __pyx_v_length;
15463 PyObject *__pyx_r = NULL;
15464 __Pyx_TraceDeclarations
15465 __Pyx_RefNannyDeclarations
15466 PyObject *__pyx_t_1 = NULL;
15467 Py_ssize_t *__pyx_t_2;
15468 Py_ssize_t *__pyx_t_3;
15469 Py_ssize_t *__pyx_t_4;
15470 PyObject *__pyx_t_5 = NULL;
15471 int __pyx_lineno = 0;
15472 const char *__pyx_filename = NULL;
15473 int __pyx_clineno = 0;
15474 __Pyx_RefNannySetupContext(
"__get__", 0);
15475 __Pyx_TraceCall(
"__get__", __pyx_f[1], 565, 0, __PYX_ERR(1, 565, __pyx_L1_error));
15484 __Pyx_TraceLine(566,0,__PYX_ERR(1, 566, __pyx_L1_error))
15485 __Pyx_XDECREF(__pyx_r);
15486 __pyx_t_1 = PyList_New(0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 566, __pyx_L1_error)
15487 __Pyx_GOTREF(__pyx_t_1);
15488 __pyx_t_3 = (__pyx_v_self->view.shape + __pyx_v_self->view.ndim);
15489 for (__pyx_t_4 = __pyx_v_self->view.shape; __pyx_t_4 < __pyx_t_3; __pyx_t_4++) {
15490 __pyx_t_2 = __pyx_t_4;
15491 __pyx_v_length = (__pyx_t_2[0]);
15492 __pyx_t_5 = PyInt_FromSsize_t(__pyx_v_length);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 566, __pyx_L1_error)
15493 __Pyx_GOTREF(__pyx_t_5);
15494 if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(1, 566, __pyx_L1_error)
15495 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
15497 __pyx_t_5 = PyList_AsTuple(((PyObject*)__pyx_t_1));
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 566, __pyx_L1_error)
15498 __Pyx_GOTREF(__pyx_t_5);
15499 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
15500 __pyx_r = __pyx_t_5;
15514 __Pyx_XDECREF(__pyx_t_1);
15515 __Pyx_XDECREF(__pyx_t_5);
15516 __Pyx_AddTraceback(
"View.MemoryView.memoryview.shape.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
15519 __Pyx_XGIVEREF(__pyx_r);
15520 __Pyx_TraceReturn(__pyx_r, 0);
15521 __Pyx_RefNannyFinishContext();
15534 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(PyObject *__pyx_v_self);
15535 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(PyObject *__pyx_v_self) {
15536 PyObject *__pyx_r = 0;
15537 __Pyx_RefNannyDeclarations
15538 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
15539 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
15542 __Pyx_RefNannyFinishContext();
15546 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(
struct __pyx_memoryview_obj *__pyx_v_self) {
15547 Py_ssize_t __pyx_v_stride;
15548 PyObject *__pyx_r = NULL;
15549 __Pyx_TraceDeclarations
15550 __Pyx_RefNannyDeclarations
15552 PyObject *__pyx_t_2 = NULL;
15553 Py_ssize_t *__pyx_t_3;
15554 Py_ssize_t *__pyx_t_4;
15555 Py_ssize_t *__pyx_t_5;
15556 PyObject *__pyx_t_6 = NULL;
15557 int __pyx_lineno = 0;
15558 const char *__pyx_filename = NULL;
15559 int __pyx_clineno = 0;
15560 __Pyx_RefNannySetupContext(
"__get__", 0);
15561 __Pyx_TraceCall(
"__get__", __pyx_f[1], 569, 0, __PYX_ERR(1, 569, __pyx_L1_error));
15570 __Pyx_TraceLine(570,0,__PYX_ERR(1, 570, __pyx_L1_error))
15571 __pyx_t_1 = ((__pyx_v_self->view.strides == NULL) != 0);
15572 if (unlikely(__pyx_t_1)) {
15581 __Pyx_TraceLine(572,0,__PYX_ERR(1, 572, __pyx_L1_error))
15582 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__18, NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 572, __pyx_L1_error)
15583 __Pyx_GOTREF(__pyx_t_2);
15584 __Pyx_Raise(__pyx_t_2, 0, 0, 0);
15585 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
15586 __PYX_ERR(1, 572, __pyx_L1_error)
15604 __Pyx_TraceLine(574,0,__PYX_ERR(1, 574, __pyx_L1_error))
15605 __Pyx_XDECREF(__pyx_r);
15606 __pyx_t_2 = PyList_New(0);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 574, __pyx_L1_error)
15607 __Pyx_GOTREF(__pyx_t_2);
15608 __pyx_t_4 = (__pyx_v_self->view.strides + __pyx_v_self->view.ndim);
15609 for (__pyx_t_5 = __pyx_v_self->view.strides; __pyx_t_5 < __pyx_t_4; __pyx_t_5++) {
15610 __pyx_t_3 = __pyx_t_5;
15611 __pyx_v_stride = (__pyx_t_3[0]);
15612 __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_stride);
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 574, __pyx_L1_error)
15613 __Pyx_GOTREF(__pyx_t_6);
15614 if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_6))) __PYX_ERR(1, 574, __pyx_L1_error)
15615 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
15617 __pyx_t_6 = PyList_AsTuple(((PyObject*)__pyx_t_2));
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 574, __pyx_L1_error)
15618 __Pyx_GOTREF(__pyx_t_6);
15619 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
15620 __pyx_r = __pyx_t_6;
15634 __Pyx_XDECREF(__pyx_t_2);
15635 __Pyx_XDECREF(__pyx_t_6);
15636 __Pyx_AddTraceback(
"View.MemoryView.memoryview.strides.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
15639 __Pyx_XGIVEREF(__pyx_r);
15640 __Pyx_TraceReturn(__pyx_r, 0);
15641 __Pyx_RefNannyFinishContext();
15654 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(PyObject *__pyx_v_self);
15655 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(PyObject *__pyx_v_self) {
15656 PyObject *__pyx_r = 0;
15657 __Pyx_RefNannyDeclarations
15658 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
15659 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
15662 __Pyx_RefNannyFinishContext();
15666 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(
struct __pyx_memoryview_obj *__pyx_v_self) {
15667 Py_ssize_t __pyx_v_suboffset;
15668 PyObject *__pyx_r = NULL;
15669 __Pyx_TraceDeclarations
15670 __Pyx_RefNannyDeclarations
15672 PyObject *__pyx_t_2 = NULL;
15673 PyObject *__pyx_t_3 = NULL;
15674 Py_ssize_t *__pyx_t_4;
15675 Py_ssize_t *__pyx_t_5;
15676 Py_ssize_t *__pyx_t_6;
15677 int __pyx_lineno = 0;
15678 const char *__pyx_filename = NULL;
15679 int __pyx_clineno = 0;
15680 __Pyx_RefNannySetupContext(
"__get__", 0);
15681 __Pyx_TraceCall(
"__get__", __pyx_f[1], 577, 0, __PYX_ERR(1, 577, __pyx_L1_error));
15690 __Pyx_TraceLine(578,0,__PYX_ERR(1, 578, __pyx_L1_error))
15691 __pyx_t_1 = ((__pyx_v_self->view.suboffsets == NULL) != 0);
15701 __Pyx_TraceLine(579,0,__PYX_ERR(1, 579, __pyx_L1_error))
15702 __Pyx_XDECREF(__pyx_r);
15703 __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 579, __pyx_L1_error)
15704 __Pyx_GOTREF(__pyx_t_2);
15705 __pyx_t_3 = PyNumber_Multiply(__pyx_tuple__19, __pyx_t_2);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 579, __pyx_L1_error)
15706 __Pyx_GOTREF(__pyx_t_3);
15707 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
15708 __pyx_r = __pyx_t_3;
15728 __Pyx_TraceLine(581,0,__PYX_ERR(1, 581, __pyx_L1_error))
15729 __Pyx_XDECREF(__pyx_r);
15730 __pyx_t_3 = PyList_New(0);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 581, __pyx_L1_error)
15731 __Pyx_GOTREF(__pyx_t_3);
15732 __pyx_t_5 = (__pyx_v_self->view.suboffsets + __pyx_v_self->view.ndim);
15733 for (__pyx_t_6 = __pyx_v_self->view.suboffsets; __pyx_t_6 < __pyx_t_5; __pyx_t_6++) {
15734 __pyx_t_4 = __pyx_t_6;
15735 __pyx_v_suboffset = (__pyx_t_4[0]);
15736 __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_suboffset);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 581, __pyx_L1_error)
15737 __Pyx_GOTREF(__pyx_t_2);
15738 if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_2))) __PYX_ERR(1, 581, __pyx_L1_error)
15739 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
15741 __pyx_t_2 = PyList_AsTuple(((PyObject*)__pyx_t_3));
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 581, __pyx_L1_error)
15742 __Pyx_GOTREF(__pyx_t_2);
15743 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15744 __pyx_r = __pyx_t_2;
15758 __Pyx_XDECREF(__pyx_t_2);
15759 __Pyx_XDECREF(__pyx_t_3);
15760 __Pyx_AddTraceback(
"View.MemoryView.memoryview.suboffsets.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
15763 __Pyx_XGIVEREF(__pyx_r);
15764 __Pyx_TraceReturn(__pyx_r, 0);
15765 __Pyx_RefNannyFinishContext();
15778 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(PyObject *__pyx_v_self);
15779 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(PyObject *__pyx_v_self) {
15780 PyObject *__pyx_r = 0;
15781 __Pyx_RefNannyDeclarations
15782 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
15783 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
15786 __Pyx_RefNannyFinishContext();
15790 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(
struct __pyx_memoryview_obj *__pyx_v_self) {
15791 PyObject *__pyx_r = NULL;
15792 __Pyx_TraceDeclarations
15793 __Pyx_RefNannyDeclarations
15794 PyObject *__pyx_t_1 = NULL;
15795 int __pyx_lineno = 0;
15796 const char *__pyx_filename = NULL;
15797 int __pyx_clineno = 0;
15798 __Pyx_RefNannySetupContext(
"__get__", 0);
15799 __Pyx_TraceCall(
"__get__", __pyx_f[1], 584, 0, __PYX_ERR(1, 584, __pyx_L1_error));
15808 __Pyx_TraceLine(585,0,__PYX_ERR(1, 585, __pyx_L1_error))
15809 __Pyx_XDECREF(__pyx_r);
15810 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 585, __pyx_L1_error)
15811 __Pyx_GOTREF(__pyx_t_1);
15812 __pyx_r = __pyx_t_1;
15826 __Pyx_XDECREF(__pyx_t_1);
15827 __Pyx_AddTraceback(
"View.MemoryView.memoryview.ndim.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
15830 __Pyx_XGIVEREF(__pyx_r);
15831 __Pyx_TraceReturn(__pyx_r, 0);
15832 __Pyx_RefNannyFinishContext();
15845 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(PyObject *__pyx_v_self);
15846 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(PyObject *__pyx_v_self) {
15847 PyObject *__pyx_r = 0;
15848 __Pyx_RefNannyDeclarations
15849 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
15850 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
15853 __Pyx_RefNannyFinishContext();
15857 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(
struct __pyx_memoryview_obj *__pyx_v_self) {
15858 PyObject *__pyx_r = NULL;
15859 __Pyx_TraceDeclarations
15860 __Pyx_RefNannyDeclarations
15861 PyObject *__pyx_t_1 = NULL;
15862 int __pyx_lineno = 0;
15863 const char *__pyx_filename = NULL;
15864 int __pyx_clineno = 0;
15865 __Pyx_RefNannySetupContext(
"__get__", 0);
15866 __Pyx_TraceCall(
"__get__", __pyx_f[1], 588, 0, __PYX_ERR(1, 588, __pyx_L1_error));
15875 __Pyx_TraceLine(589,0,__PYX_ERR(1, 589, __pyx_L1_error))
15876 __Pyx_XDECREF(__pyx_r);
15877 __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 589, __pyx_L1_error)
15878 __Pyx_GOTREF(__pyx_t_1);
15879 __pyx_r = __pyx_t_1;
15893 __Pyx_XDECREF(__pyx_t_1);
15894 __Pyx_AddTraceback(
"View.MemoryView.memoryview.itemsize.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
15897 __Pyx_XGIVEREF(__pyx_r);
15898 __Pyx_TraceReturn(__pyx_r, 0);
15899 __Pyx_RefNannyFinishContext();
15912 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(PyObject *__pyx_v_self);
15913 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(PyObject *__pyx_v_self) {
15914 PyObject *__pyx_r = 0;
15915 __Pyx_RefNannyDeclarations
15916 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
15917 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
15920 __Pyx_RefNannyFinishContext();
15924 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(
struct __pyx_memoryview_obj *__pyx_v_self) {
15925 PyObject *__pyx_r = NULL;
15926 __Pyx_TraceDeclarations
15927 __Pyx_RefNannyDeclarations
15928 PyObject *__pyx_t_1 = NULL;
15929 PyObject *__pyx_t_2 = NULL;
15930 PyObject *__pyx_t_3 = NULL;
15931 int __pyx_lineno = 0;
15932 const char *__pyx_filename = NULL;
15933 int __pyx_clineno = 0;
15934 __Pyx_RefNannySetupContext(
"__get__", 0);
15935 __Pyx_TraceCall(
"__get__", __pyx_f[1], 592, 0, __PYX_ERR(1, 592, __pyx_L1_error));
15944 __Pyx_TraceLine(593,0,__PYX_ERR(1, 593, __pyx_L1_error))
15945 __Pyx_XDECREF(__pyx_r);
15946 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_size);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 593, __pyx_L1_error)
15947 __Pyx_GOTREF(__pyx_t_1);
15948 __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 593, __pyx_L1_error)
15949 __Pyx_GOTREF(__pyx_t_2);
15950 __pyx_t_3 = PyNumber_Multiply(__pyx_t_1, __pyx_t_2);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 593, __pyx_L1_error)
15951 __Pyx_GOTREF(__pyx_t_3);
15952 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
15953 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
15954 __pyx_r = __pyx_t_3;
15968 __Pyx_XDECREF(__pyx_t_1);
15969 __Pyx_XDECREF(__pyx_t_2);
15970 __Pyx_XDECREF(__pyx_t_3);
15971 __Pyx_AddTraceback(
"View.MemoryView.memoryview.nbytes.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
15974 __Pyx_XGIVEREF(__pyx_r);
15975 __Pyx_TraceReturn(__pyx_r, 0);
15976 __Pyx_RefNannyFinishContext();
15989 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(PyObject *__pyx_v_self);
15990 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(PyObject *__pyx_v_self) {
15991 PyObject *__pyx_r = 0;
15992 __Pyx_RefNannyDeclarations
15993 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
15994 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
15997 __Pyx_RefNannyFinishContext();
16001 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(
struct __pyx_memoryview_obj *__pyx_v_self) {
16002 PyObject *__pyx_v_result = NULL;
16003 PyObject *__pyx_v_length = NULL;
16004 PyObject *__pyx_r = NULL;
16005 __Pyx_TraceDeclarations
16006 __Pyx_RefNannyDeclarations
16009 Py_ssize_t *__pyx_t_3;
16010 Py_ssize_t *__pyx_t_4;
16011 Py_ssize_t *__pyx_t_5;
16012 PyObject *__pyx_t_6 = NULL;
16013 int __pyx_lineno = 0;
16014 const char *__pyx_filename = NULL;
16015 int __pyx_clineno = 0;
16016 __Pyx_RefNannySetupContext(
"__get__", 0);
16017 __Pyx_TraceCall(
"__get__", __pyx_f[1], 596, 0, __PYX_ERR(1, 596, __pyx_L1_error));
16026 __Pyx_TraceLine(597,0,__PYX_ERR(1, 597, __pyx_L1_error))
16027 __pyx_t_1 = (__pyx_v_self->_size == Py_None);
16028 __pyx_t_2 = (__pyx_t_1 != 0);
16038 __Pyx_TraceLine(598,0,__PYX_ERR(1, 598, __pyx_L1_error))
16039 __Pyx_INCREF(__pyx_int_1);
16040 __pyx_v_result = __pyx_int_1;
16049 __Pyx_TraceLine(600,0,__PYX_ERR(1, 600, __pyx_L1_error))
16050 __pyx_t_4 = (__pyx_v_self->view.shape + __pyx_v_self->view.ndim);
16051 for (__pyx_t_5 = __pyx_v_self->view.shape; __pyx_t_5 < __pyx_t_4; __pyx_t_5++) {
16052 __pyx_t_3 = __pyx_t_5;
16053 __pyx_t_6 = PyInt_FromSsize_t((__pyx_t_3[0]));
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 600, __pyx_L1_error)
16054 __Pyx_GOTREF(__pyx_t_6);
16055 __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_6);
16065 __Pyx_TraceLine(601,0,__PYX_ERR(1, 601, __pyx_L1_error))
16066 __pyx_t_6 = PyNumber_InPlaceMultiply(__pyx_v_result, __pyx_v_length);
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 601, __pyx_L1_error)
16067 __Pyx_GOTREF(__pyx_t_6);
16068 __Pyx_DECREF_SET(__pyx_v_result, __pyx_t_6);
16079 __Pyx_TraceLine(603,0,__PYX_ERR(1, 603, __pyx_L1_error))
16080 __Pyx_INCREF(__pyx_v_result);
16081 __Pyx_GIVEREF(__pyx_v_result);
16082 __Pyx_GOTREF(__pyx_v_self->_size);
16083 __Pyx_DECREF(__pyx_v_self->_size);
16084 __pyx_v_self->_size = __pyx_v_result;
16102 __Pyx_TraceLine(605,0,__PYX_ERR(1, 605, __pyx_L1_error))
16103 __Pyx_XDECREF(__pyx_r);
16104 __Pyx_INCREF(__pyx_v_self->_size);
16105 __pyx_r = __pyx_v_self->_size;
16118 __Pyx_XDECREF(__pyx_t_6);
16119 __Pyx_AddTraceback(
"View.MemoryView.memoryview.size.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
16122 __Pyx_XDECREF(__pyx_v_result);
16123 __Pyx_XDECREF(__pyx_v_length);
16124 __Pyx_XGIVEREF(__pyx_r);
16125 __Pyx_TraceReturn(__pyx_r, 0);
16126 __Pyx_RefNannyFinishContext();
16139 static Py_ssize_t __pyx_memoryview___len__(PyObject *__pyx_v_self);
16140 static Py_ssize_t __pyx_memoryview___len__(PyObject *__pyx_v_self) {
16141 Py_ssize_t __pyx_r;
16142 __Pyx_RefNannyDeclarations
16143 __Pyx_RefNannySetupContext(
"__len__ (wrapper)", 0);
16144 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
16147 __Pyx_RefNannyFinishContext();
16151 static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(
struct __pyx_memoryview_obj *__pyx_v_self) {
16152 Py_ssize_t __pyx_r;
16153 __Pyx_TraceDeclarations
16154 __Pyx_RefNannyDeclarations
16156 int __pyx_lineno = 0;
16157 const char *__pyx_filename = NULL;
16158 int __pyx_clineno = 0;
16159 __Pyx_RefNannySetupContext(
"__len__", 0);
16160 __Pyx_TraceCall(
"__len__", __pyx_f[1], 607, 0, __PYX_ERR(1, 607, __pyx_L1_error));
16169 __Pyx_TraceLine(608,0,__PYX_ERR(1, 608, __pyx_L1_error))
16170 __pyx_t_1 = ((__pyx_v_self->view.ndim >= 1) != 0);
16180 __Pyx_TraceLine(609,0,__PYX_ERR(1, 609, __pyx_L1_error))
16181 __pyx_r = (__pyx_v_self->view.shape[0]);
16200 __Pyx_TraceLine(611,0,__PYX_ERR(1, 611, __pyx_L1_error))
16214 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__len__", __pyx_clineno, __pyx_lineno, __pyx_filename);
16217 __Pyx_TraceReturn(Py_None, 0);
16218 __Pyx_RefNannyFinishContext();
16231 static PyObject *__pyx_memoryview___repr__(PyObject *__pyx_v_self);
16232 static PyObject *__pyx_memoryview___repr__(PyObject *__pyx_v_self) {
16233 PyObject *__pyx_r = 0;
16234 __Pyx_RefNannyDeclarations
16235 __Pyx_RefNannySetupContext(
"__repr__ (wrapper)", 0);
16236 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
16239 __Pyx_RefNannyFinishContext();
16243 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(
struct __pyx_memoryview_obj *__pyx_v_self) {
16244 PyObject *__pyx_r = NULL;
16245 __Pyx_TraceDeclarations
16246 __Pyx_RefNannyDeclarations
16247 PyObject *__pyx_t_1 = NULL;
16248 PyObject *__pyx_t_2 = NULL;
16249 PyObject *__pyx_t_3 = NULL;
16250 int __pyx_lineno = 0;
16251 const char *__pyx_filename = NULL;
16252 int __pyx_clineno = 0;
16253 __Pyx_RefNannySetupContext(
"__repr__", 0);
16254 __Pyx_TraceCall(
"__repr__", __pyx_f[1], 613, 0, __PYX_ERR(1, 613, __pyx_L1_error));
16263 __Pyx_TraceLine(614,0,__PYX_ERR(1, 614, __pyx_L1_error))
16264 __Pyx_XDECREF(__pyx_r);
16265 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 614, __pyx_L1_error)
16266 __Pyx_GOTREF(__pyx_t_1);
16267 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 614, __pyx_L1_error)
16268 __Pyx_GOTREF(__pyx_t_2);
16269 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
16270 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 614, __pyx_L1_error)
16271 __Pyx_GOTREF(__pyx_t_1);
16272 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
16281 __Pyx_TraceLine(615,0,__PYX_ERR(1, 615, __pyx_L1_error))
16282 __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_self));
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 615, __pyx_L1_error)
16283 __Pyx_GOTREF(__pyx_t_2);
16292 __Pyx_TraceLine(614,0,__PYX_ERR(1, 614, __pyx_L1_error))
16293 __pyx_t_3 = PyTuple_New(2);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 614, __pyx_L1_error)
16294 __Pyx_GOTREF(__pyx_t_3);
16295 __Pyx_GIVEREF(__pyx_t_1);
16296 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
16297 __Pyx_GIVEREF(__pyx_t_2);
16298 PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
16301 __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_at_0x_x, __pyx_t_3);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 614, __pyx_L1_error)
16302 __Pyx_GOTREF(__pyx_t_2);
16303 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16304 __pyx_r = __pyx_t_2;
16318 __Pyx_XDECREF(__pyx_t_1);
16319 __Pyx_XDECREF(__pyx_t_2);
16320 __Pyx_XDECREF(__pyx_t_3);
16321 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
16324 __Pyx_XGIVEREF(__pyx_r);
16325 __Pyx_TraceReturn(__pyx_r, 0);
16326 __Pyx_RefNannyFinishContext();
16339 static PyObject *__pyx_memoryview___str__(PyObject *__pyx_v_self);
16340 static PyObject *__pyx_memoryview___str__(PyObject *__pyx_v_self) {
16341 PyObject *__pyx_r = 0;
16342 __Pyx_RefNannyDeclarations
16343 __Pyx_RefNannySetupContext(
"__str__ (wrapper)", 0);
16344 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
16347 __Pyx_RefNannyFinishContext();
16351 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(
struct __pyx_memoryview_obj *__pyx_v_self) {
16352 PyObject *__pyx_r = NULL;
16353 __Pyx_TraceDeclarations
16354 __Pyx_RefNannyDeclarations
16355 PyObject *__pyx_t_1 = NULL;
16356 PyObject *__pyx_t_2 = NULL;
16357 int __pyx_lineno = 0;
16358 const char *__pyx_filename = NULL;
16359 int __pyx_clineno = 0;
16360 __Pyx_RefNannySetupContext(
"__str__", 0);
16361 __Pyx_TraceCall(
"__str__", __pyx_f[1], 617, 0, __PYX_ERR(1, 617, __pyx_L1_error));
16370 __Pyx_TraceLine(618,0,__PYX_ERR(1, 618, __pyx_L1_error))
16371 __Pyx_XDECREF(__pyx_r);
16372 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 618, __pyx_L1_error)
16373 __Pyx_GOTREF(__pyx_t_1);
16374 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 618, __pyx_L1_error)
16375 __Pyx_GOTREF(__pyx_t_2);
16376 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
16377 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 618, __pyx_L1_error)
16378 __Pyx_GOTREF(__pyx_t_1);
16379 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
16380 __pyx_t_2 = PyTuple_New(1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 618, __pyx_L1_error)
16381 __Pyx_GOTREF(__pyx_t_2);
16382 __Pyx_GIVEREF(__pyx_t_1);
16383 PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
16385 __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_object, __pyx_t_2);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 618, __pyx_L1_error)
16386 __Pyx_GOTREF(__pyx_t_1);
16387 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
16388 __pyx_r = __pyx_t_1;
16402 __Pyx_XDECREF(__pyx_t_1);
16403 __Pyx_XDECREF(__pyx_t_2);
16404 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename);
16407 __Pyx_XGIVEREF(__pyx_r);
16408 __Pyx_TraceReturn(__pyx_r, 0);
16409 __Pyx_RefNannyFinishContext();
16422 static PyObject *__pyx_memoryview_is_c_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
16423 static PyMethodDef __pyx_mdef_15View_dot_MemoryView_10memoryview_17is_c_contig = {
"is_c_contig", (PyCFunction)__pyx_memoryview_is_c_contig, METH_NOARGS, 0};
16424 static PyObject *__pyx_memoryview_is_c_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
16425 PyObject *__pyx_r = 0;
16426 __Pyx_RefNannyDeclarations
16427 __Pyx_RefNannySetupContext(
"is_c_contig (wrapper)", 0);
16428 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(((
struct __pyx_memoryview_obj *)__pyx_v_self));
16431 __Pyx_RefNannyFinishContext();
16435 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(
struct __pyx_memoryview_obj *__pyx_v_self) {
16436 __Pyx_memviewslice *__pyx_v_mslice;
16437 __Pyx_memviewslice __pyx_v_tmp;
16438 PyObject *__pyx_r = NULL;
16439 __Pyx_TraceDeclarations
16440 __Pyx_RefNannyDeclarations
16441 __Pyx_memviewslice *__pyx_t_1;
16442 PyObject *__pyx_t_2 = NULL;
16443 int __pyx_lineno = 0;
16444 const char *__pyx_filename = NULL;
16445 int __pyx_clineno = 0;
16446 __Pyx_RefNannySetupContext(
"is_c_contig", 0);
16447 __Pyx_TraceCall(
"is_c_contig", __pyx_f[1], 621, 0, __PYX_ERR(1, 621, __pyx_L1_error));
16456 __Pyx_TraceLine(624,0,__PYX_ERR(1, 624, __pyx_L1_error))
16457 __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp));
if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(1, 624, __pyx_L1_error)
16458 __pyx_v_mslice = __pyx_t_1;
16467 __Pyx_TraceLine(625,0,__PYX_ERR(1, 625, __pyx_L1_error))
16468 __Pyx_XDECREF(__pyx_r);
16469 __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig((__pyx_v_mslice[0]),
'C', __pyx_v_self->view.ndim));
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 625, __pyx_L1_error)
16470 __Pyx_GOTREF(__pyx_t_2);
16471 __pyx_r = __pyx_t_2;
16485 __Pyx_XDECREF(__pyx_t_2);
16486 __Pyx_AddTraceback(
"View.MemoryView.memoryview.is_c_contig", __pyx_clineno, __pyx_lineno, __pyx_filename);
16489 __Pyx_XGIVEREF(__pyx_r);
16490 __Pyx_TraceReturn(__pyx_r, 0);
16491 __Pyx_RefNannyFinishContext();
16504 static PyObject *__pyx_memoryview_is_f_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
16505 static PyMethodDef __pyx_mdef_15View_dot_MemoryView_10memoryview_19is_f_contig = {
"is_f_contig", (PyCFunction)__pyx_memoryview_is_f_contig, METH_NOARGS, 0};
16506 static PyObject *__pyx_memoryview_is_f_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
16507 PyObject *__pyx_r = 0;
16508 __Pyx_RefNannyDeclarations
16509 __Pyx_RefNannySetupContext(
"is_f_contig (wrapper)", 0);
16510 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(((
struct __pyx_memoryview_obj *)__pyx_v_self));
16513 __Pyx_RefNannyFinishContext();
16517 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(
struct __pyx_memoryview_obj *__pyx_v_self) {
16518 __Pyx_memviewslice *__pyx_v_mslice;
16519 __Pyx_memviewslice __pyx_v_tmp;
16520 PyObject *__pyx_r = NULL;
16521 __Pyx_TraceDeclarations
16522 __Pyx_RefNannyDeclarations
16523 __Pyx_memviewslice *__pyx_t_1;
16524 PyObject *__pyx_t_2 = NULL;
16525 int __pyx_lineno = 0;
16526 const char *__pyx_filename = NULL;
16527 int __pyx_clineno = 0;
16528 __Pyx_RefNannySetupContext(
"is_f_contig", 0);
16529 __Pyx_TraceCall(
"is_f_contig", __pyx_f[1], 627, 0, __PYX_ERR(1, 627, __pyx_L1_error));
16538 __Pyx_TraceLine(630,0,__PYX_ERR(1, 630, __pyx_L1_error))
16539 __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp));
if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(1, 630, __pyx_L1_error)
16540 __pyx_v_mslice = __pyx_t_1;
16549 __Pyx_TraceLine(631,0,__PYX_ERR(1, 631, __pyx_L1_error))
16550 __Pyx_XDECREF(__pyx_r);
16551 __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig((__pyx_v_mslice[0]),
'F', __pyx_v_self->view.ndim));
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 631, __pyx_L1_error)
16552 __Pyx_GOTREF(__pyx_t_2);
16553 __pyx_r = __pyx_t_2;
16567 __Pyx_XDECREF(__pyx_t_2);
16568 __Pyx_AddTraceback(
"View.MemoryView.memoryview.is_f_contig", __pyx_clineno, __pyx_lineno, __pyx_filename);
16571 __Pyx_XGIVEREF(__pyx_r);
16572 __Pyx_TraceReturn(__pyx_r, 0);
16573 __Pyx_RefNannyFinishContext();
16586 static PyObject *__pyx_memoryview_copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
16587 static PyMethodDef __pyx_mdef_15View_dot_MemoryView_10memoryview_21copy = {
"copy", (PyCFunction)__pyx_memoryview_copy, METH_NOARGS, 0};
16588 static PyObject *__pyx_memoryview_copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
16589 PyObject *__pyx_r = 0;
16590 __Pyx_RefNannyDeclarations
16591 __Pyx_RefNannySetupContext(
"copy (wrapper)", 0);
16592 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(((
struct __pyx_memoryview_obj *)__pyx_v_self));
16595 __Pyx_RefNannyFinishContext();
16599 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(
struct __pyx_memoryview_obj *__pyx_v_self) {
16600 __Pyx_memviewslice __pyx_v_mslice;
16602 PyObject *__pyx_r = NULL;
16603 __Pyx_TraceDeclarations
16604 __Pyx_RefNannyDeclarations
16605 __Pyx_memviewslice __pyx_t_1;
16606 PyObject *__pyx_t_2 = NULL;
16607 int __pyx_lineno = 0;
16608 const char *__pyx_filename = NULL;
16609 int __pyx_clineno = 0;
16610 __Pyx_RefNannySetupContext(
"copy", 0);
16611 __Pyx_TraceCall(
"copy", __pyx_f[1], 633, 0, __PYX_ERR(1, 633, __pyx_L1_error));
16620 __Pyx_TraceLine(635,0,__PYX_ERR(1, 635, __pyx_L1_error))
16621 __pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_F_CONTIGUOUS));
16630 __Pyx_TraceLine(637,0,__PYX_ERR(1, 637, __pyx_L1_error))
16631 __pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_mslice));
16640 __Pyx_TraceLine(638,0,__PYX_ERR(1, 638, __pyx_L1_error))
16641 __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_mslice), ((
char *)
"c"), __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_C_CONTIGUOUS), __pyx_v_self->dtype_is_object);
if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 638, __pyx_L1_error)
16642 __pyx_v_mslice = __pyx_t_1;
16651 __Pyx_TraceLine(643,0,__PYX_ERR(1, 643, __pyx_L1_error))
16652 __Pyx_XDECREF(__pyx_r);
16653 __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_mslice));
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 643, __pyx_L1_error)
16654 __Pyx_GOTREF(__pyx_t_2);
16655 __pyx_r = __pyx_t_2;
16669 __Pyx_XDECREF(__pyx_t_2);
16670 __Pyx_AddTraceback(
"View.MemoryView.memoryview.copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
16673 __Pyx_XGIVEREF(__pyx_r);
16674 __Pyx_TraceReturn(__pyx_r, 0);
16675 __Pyx_RefNannyFinishContext();
16688 static PyObject *__pyx_memoryview_copy_fortran(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
16689 static PyMethodDef __pyx_mdef_15View_dot_MemoryView_10memoryview_23copy_fortran = {
"copy_fortran", (PyCFunction)__pyx_memoryview_copy_fortran, METH_NOARGS, 0};
16690 static PyObject *__pyx_memoryview_copy_fortran(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
16691 PyObject *__pyx_r = 0;
16692 __Pyx_RefNannyDeclarations
16693 __Pyx_RefNannySetupContext(
"copy_fortran (wrapper)", 0);
16694 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(((
struct __pyx_memoryview_obj *)__pyx_v_self));
16697 __Pyx_RefNannyFinishContext();
16701 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(
struct __pyx_memoryview_obj *__pyx_v_self) {
16702 __Pyx_memviewslice __pyx_v_src;
16703 __Pyx_memviewslice __pyx_v_dst;
16705 PyObject *__pyx_r = NULL;
16706 __Pyx_TraceDeclarations
16707 __Pyx_RefNannyDeclarations
16708 __Pyx_memviewslice __pyx_t_1;
16709 PyObject *__pyx_t_2 = NULL;
16710 int __pyx_lineno = 0;
16711 const char *__pyx_filename = NULL;
16712 int __pyx_clineno = 0;
16713 __Pyx_RefNannySetupContext(
"copy_fortran", 0);
16714 __Pyx_TraceCall(
"copy_fortran", __pyx_f[1], 645, 0, __PYX_ERR(1, 645, __pyx_L1_error));
16723 __Pyx_TraceLine(647,0,__PYX_ERR(1, 647, __pyx_L1_error))
16724 __pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_C_CONTIGUOUS));
16733 __Pyx_TraceLine(649,0,__PYX_ERR(1, 649, __pyx_L1_error))
16734 __pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_src));
16743 __Pyx_TraceLine(650,0,__PYX_ERR(1, 650, __pyx_L1_error))
16744 __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_src), ((
char *)
"fortran"), __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_F_CONTIGUOUS), __pyx_v_self->dtype_is_object);
if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 650, __pyx_L1_error)
16745 __pyx_v_dst = __pyx_t_1;
16754 __Pyx_TraceLine(655,0,__PYX_ERR(1, 655, __pyx_L1_error))
16755 __Pyx_XDECREF(__pyx_r);
16756 __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_dst));
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 655, __pyx_L1_error)
16757 __Pyx_GOTREF(__pyx_t_2);
16758 __pyx_r = __pyx_t_2;
16772 __Pyx_XDECREF(__pyx_t_2);
16773 __Pyx_AddTraceback(
"View.MemoryView.memoryview.copy_fortran", __pyx_clineno, __pyx_lineno, __pyx_filename);
16776 __Pyx_XGIVEREF(__pyx_r);
16777 __Pyx_TraceReturn(__pyx_r, 0);
16778 __Pyx_RefNannyFinishContext();
16789 static PyObject *__pyx_pw___pyx_memoryview_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
16790 static PyMethodDef __pyx_mdef___pyx_memoryview_1__reduce_cython__ = {
"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_memoryview_1__reduce_cython__, METH_NOARGS, 0};
16791 static PyObject *__pyx_pw___pyx_memoryview_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
16792 PyObject *__pyx_r = 0;
16793 __Pyx_RefNannyDeclarations
16794 __Pyx_RefNannySetupContext(
"__reduce_cython__ (wrapper)", 0);
16795 __pyx_r = __pyx_pf___pyx_memoryview___reduce_cython__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
16798 __Pyx_RefNannyFinishContext();
16802 static PyObject *__pyx_pf___pyx_memoryview___reduce_cython__(CYTHON_UNUSED
struct __pyx_memoryview_obj *__pyx_v_self) {
16803 PyObject *__pyx_r = NULL;
16804 __Pyx_TraceDeclarations
16805 __Pyx_RefNannyDeclarations
16806 PyObject *__pyx_t_1 = NULL;
16807 int __pyx_lineno = 0;
16808 const char *__pyx_filename = NULL;
16809 int __pyx_clineno = 0;
16810 __Pyx_RefNannySetupContext(
"__reduce_cython__", 0);
16811 __Pyx_TraceCall(
"__reduce_cython__", __pyx_f[1], 1, 0, __PYX_ERR(1, 1, __pyx_L1_error));
16819 __Pyx_TraceLine(2,0,__PYX_ERR(1, 2, __pyx_L1_error))
16820 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__20, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
16821 __Pyx_GOTREF(__pyx_t_1);
16822 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
16823 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
16824 __PYX_ERR(1, 2, __pyx_L1_error)
16834 __Pyx_XDECREF(__pyx_t_1);
16835 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
16837 __Pyx_XGIVEREF(__pyx_r);
16838 __Pyx_TraceReturn(__pyx_r, 0);
16839 __Pyx_RefNannyFinishContext();
16851 static PyObject *__pyx_pw___pyx_memoryview_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state);
16852 static PyMethodDef __pyx_mdef___pyx_memoryview_3__setstate_cython__ = {
"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_memoryview_3__setstate_cython__, METH_O, 0};
16853 static PyObject *__pyx_pw___pyx_memoryview_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
16854 PyObject *__pyx_r = 0;
16855 __Pyx_RefNannyDeclarations
16856 __Pyx_RefNannySetupContext(
"__setstate_cython__ (wrapper)", 0);
16857 __pyx_r = __pyx_pf___pyx_memoryview_2__setstate_cython__(((
struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
16860 __Pyx_RefNannyFinishContext();
16864 static PyObject *__pyx_pf___pyx_memoryview_2__setstate_cython__(CYTHON_UNUSED
struct __pyx_memoryview_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
16865 PyObject *__pyx_r = NULL;
16866 __Pyx_TraceDeclarations
16867 __Pyx_RefNannyDeclarations
16868 PyObject *__pyx_t_1 = NULL;
16869 int __pyx_lineno = 0;
16870 const char *__pyx_filename = NULL;
16871 int __pyx_clineno = 0;
16872 __Pyx_RefNannySetupContext(
"__setstate_cython__", 0);
16873 __Pyx_TraceCall(
"__setstate_cython__", __pyx_f[1], 3, 0, __PYX_ERR(1, 3, __pyx_L1_error));
16880 __Pyx_TraceLine(4,0,__PYX_ERR(1, 4, __pyx_L1_error))
16881 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__21, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
16882 __Pyx_GOTREF(__pyx_t_1);
16883 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
16884 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
16885 __PYX_ERR(1, 4, __pyx_L1_error)
16896 __Pyx_XDECREF(__pyx_t_1);
16897 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
16899 __Pyx_XGIVEREF(__pyx_r);
16900 __Pyx_TraceReturn(__pyx_r, 0);
16901 __Pyx_RefNannyFinishContext();
16913 static PyObject *__pyx_memoryview_new(PyObject *__pyx_v_o,
int __pyx_v_flags,
int __pyx_v_dtype_is_object, __Pyx_TypeInfo *__pyx_v_typeinfo) {
16914 struct __pyx_memoryview_obj *__pyx_v_result = 0;
16915 PyObject *__pyx_r = NULL;
16916 __Pyx_TraceDeclarations
16917 __Pyx_RefNannyDeclarations
16918 PyObject *__pyx_t_1 = NULL;
16919 PyObject *__pyx_t_2 = NULL;
16920 PyObject *__pyx_t_3 = NULL;
16921 int __pyx_lineno = 0;
16922 const char *__pyx_filename = NULL;
16923 int __pyx_clineno = 0;
16924 __Pyx_RefNannySetupContext(
"memoryview_cwrapper", 0);
16925 __Pyx_TraceCall(
"memoryview_cwrapper", __pyx_f[1], 659, 0, __PYX_ERR(1, 659, __pyx_L1_error));
16934 __Pyx_TraceLine(660,0,__PYX_ERR(1, 660, __pyx_L1_error))
16935 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 660, __pyx_L1_error)
16936 __Pyx_GOTREF(__pyx_t_1);
16937 __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 660, __pyx_L1_error)
16938 __Pyx_GOTREF(__pyx_t_2);
16939 __pyx_t_3 = PyTuple_New(3);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 660, __pyx_L1_error)
16940 __Pyx_GOTREF(__pyx_t_3);
16941 __Pyx_INCREF(__pyx_v_o);
16942 __Pyx_GIVEREF(__pyx_v_o);
16943 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_o);
16944 __Pyx_GIVEREF(__pyx_t_1);
16945 PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
16946 __Pyx_GIVEREF(__pyx_t_2);
16947 PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
16950 __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_3, NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 660, __pyx_L1_error)
16951 __Pyx_GOTREF(__pyx_t_2);
16952 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16953 __pyx_v_result = ((
struct __pyx_memoryview_obj *)__pyx_t_2);
16963 __Pyx_TraceLine(661,0,__PYX_ERR(1, 661, __pyx_L1_error))
16964 __pyx_v_result->typeinfo = __pyx_v_typeinfo;
16973 __Pyx_TraceLine(662,0,__PYX_ERR(1, 662, __pyx_L1_error))
16974 __Pyx_XDECREF(__pyx_r);
16975 __Pyx_INCREF(((PyObject *)__pyx_v_result));
16976 __pyx_r = ((PyObject *)__pyx_v_result);
16989 __Pyx_XDECREF(__pyx_t_1);
16990 __Pyx_XDECREF(__pyx_t_2);
16991 __Pyx_XDECREF(__pyx_t_3);
16992 __Pyx_AddTraceback(
"View.MemoryView.memoryview_cwrapper", __pyx_clineno, __pyx_lineno, __pyx_filename);
16995 __Pyx_XDECREF((PyObject *)__pyx_v_result);
16996 __Pyx_XGIVEREF(__pyx_r);
16997 __Pyx_TraceReturn(__pyx_r, 0);
16998 __Pyx_RefNannyFinishContext();
17010 static CYTHON_INLINE
int __pyx_memoryview_check(PyObject *__pyx_v_o) {
17012 __Pyx_TraceDeclarations
17013 __Pyx_RefNannyDeclarations
17015 int __pyx_lineno = 0;
17016 const char *__pyx_filename = NULL;
17017 int __pyx_clineno = 0;
17018 __Pyx_RefNannySetupContext(
"memoryview_check", 0);
17019 __Pyx_TraceCall(
"memoryview_check", __pyx_f[1], 665, 0, __PYX_ERR(1, 665, __pyx_L1_error));
17028 __Pyx_TraceLine(666,0,__PYX_ERR(1, 666, __pyx_L1_error))
17029 __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_o, __pyx_memoryview_type);
17030 __pyx_r = __pyx_t_1;
17043 __Pyx_WriteUnraisable(
"View.MemoryView.memoryview_check", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
17046 __Pyx_TraceReturn(Py_None, 0);
17047 __Pyx_RefNannyFinishContext();
17059 static PyObject *_unellipsify(PyObject *__pyx_v_index,
int __pyx_v_ndim) {
17060 PyObject *__pyx_v_tup = NULL;
17061 PyObject *__pyx_v_result = NULL;
17062 int __pyx_v_have_slices;
17063 int __pyx_v_seen_ellipsis;
17064 CYTHON_UNUSED PyObject *__pyx_v_idx = NULL;
17065 PyObject *__pyx_v_item = NULL;
17066 Py_ssize_t __pyx_v_nslices;
17067 PyObject *__pyx_r = NULL;
17068 __Pyx_TraceDeclarations
17069 __Pyx_RefNannyDeclarations
17072 PyObject *__pyx_t_3 = NULL;
17073 PyObject *__pyx_t_4 = NULL;
17074 Py_ssize_t __pyx_t_5;
17075 PyObject *(*__pyx_t_6)(PyObject *);
17076 PyObject *__pyx_t_7 = NULL;
17077 Py_ssize_t __pyx_t_8;
17080 PyObject *__pyx_t_11 = NULL;
17081 int __pyx_lineno = 0;
17082 const char *__pyx_filename = NULL;
17083 int __pyx_clineno = 0;
17084 __Pyx_RefNannySetupContext(
"_unellipsify", 0);
17085 __Pyx_TraceCall(
"_unellipsify", __pyx_f[1], 668, 0, __PYX_ERR(1, 668, __pyx_L1_error));
17094 __Pyx_TraceLine(673,0,__PYX_ERR(1, 673, __pyx_L1_error))
17095 __pyx_t_1 = PyTuple_Check(__pyx_v_index);
17096 __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
17106 __Pyx_TraceLine(674,0,__PYX_ERR(1, 674, __pyx_L1_error))
17107 __pyx_t_3 = PyTuple_New(1);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 674, __pyx_L1_error)
17108 __Pyx_GOTREF(__pyx_t_3);
17109 __Pyx_INCREF(__pyx_v_index);
17110 __Pyx_GIVEREF(__pyx_v_index);
17111 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_index);
17112 __pyx_v_tup = __pyx_t_3;
17132 __Pyx_TraceLine(676,0,__PYX_ERR(1, 676, __pyx_L1_error))
17134 __Pyx_INCREF(__pyx_v_index);
17135 __pyx_v_tup = __pyx_v_index;
17146 __Pyx_TraceLine(678,0,__PYX_ERR(1, 678, __pyx_L1_error))
17147 __pyx_t_3 = PyList_New(0);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 678, __pyx_L1_error)
17148 __Pyx_GOTREF(__pyx_t_3);
17149 __pyx_v_result = ((PyObject*)__pyx_t_3);
17159 __Pyx_TraceLine(679,0,__PYX_ERR(1, 679, __pyx_L1_error))
17160 __pyx_v_have_slices = 0;
17169 __Pyx_TraceLine(680,0,__PYX_ERR(1, 680, __pyx_L1_error))
17170 __pyx_v_seen_ellipsis = 0;
17179 __Pyx_TraceLine(681,0,__PYX_ERR(1, 681, __pyx_L1_error))
17180 __Pyx_INCREF(__pyx_int_0);
17181 __pyx_t_3 = __pyx_int_0;
17182 if (likely(PyList_CheckExact(__pyx_v_tup)) || PyTuple_CheckExact(__pyx_v_tup)) {
17183 __pyx_t_4 = __pyx_v_tup; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0;
17186 __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_tup);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 681, __pyx_L1_error)
17187 __Pyx_GOTREF(__pyx_t_4);
17188 __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext;
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 681, __pyx_L1_error)
17191 if (likely(!__pyx_t_6)) {
17192 if (likely(PyList_CheckExact(__pyx_t_4))) {
17193 if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4))
break;
17194 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
17195 __pyx_t_7 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++;
if (unlikely(0 < 0)) __PYX_ERR(1, 681, __pyx_L1_error)
17197 __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++;
if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 681, __pyx_L1_error)
17198 __Pyx_GOTREF(__pyx_t_7);
17201 if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4))
break;
17202 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
17203 __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++;
if (unlikely(0 < 0)) __PYX_ERR(1, 681, __pyx_L1_error)
17205 __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++;
if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 681, __pyx_L1_error)
17206 __Pyx_GOTREF(__pyx_t_7);
17210 __pyx_t_7 = __pyx_t_6(__pyx_t_4);
17211 if (unlikely(!__pyx_t_7)) {
17212 PyObject* exc_type = PyErr_Occurred();
17214 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
17215 else __PYX_ERR(1, 681, __pyx_L1_error)
17219 __Pyx_GOTREF(__pyx_t_7);
17221 __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_7);
17223 __Pyx_INCREF(__pyx_t_3);
17224 __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_3);
17225 __pyx_t_7 = __Pyx_PyInt_AddObjC(__pyx_t_3, __pyx_int_1, 1, 0, 0);
if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 681, __pyx_L1_error)
17226 __Pyx_GOTREF(__pyx_t_7);
17227 __Pyx_DECREF(__pyx_t_3);
17228 __pyx_t_3 = __pyx_t_7;
17238 __Pyx_TraceLine(682,0,__PYX_ERR(1, 682, __pyx_L1_error))
17239 __pyx_t_2 = (__pyx_v_item == __pyx_builtin_Ellipsis);
17240 __pyx_t_1 = (__pyx_t_2 != 0);
17250 __Pyx_TraceLine(683,0,__PYX_ERR(1, 683, __pyx_L1_error))
17251 __pyx_t_1 = ((!(__pyx_v_seen_ellipsis != 0)) != 0);
17261 __Pyx_TraceLine(684,0,__PYX_ERR(1, 684, __pyx_L1_error))
17262 __pyx_t_8 = PyObject_Length(__pyx_v_tup);
if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(1, 684, __pyx_L1_error)
17263 __pyx_t_7 = PyList_New(1 * ((((__pyx_v_ndim - __pyx_t_8) + 1)<0) ? 0:((__pyx_v_ndim - __pyx_t_8) + 1)));
if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 684, __pyx_L1_error)
17264 __Pyx_GOTREF(__pyx_t_7);
17265 { Py_ssize_t __pyx_temp;
17266 for (__pyx_temp=0; __pyx_temp < ((__pyx_v_ndim - __pyx_t_8) + 1); __pyx_temp++) {
17267 __Pyx_INCREF(__pyx_slice__4);
17268 __Pyx_GIVEREF(__pyx_slice__4);
17269 PyList_SET_ITEM(__pyx_t_7, __pyx_temp, __pyx_slice__4);
17272 __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_7);
if (unlikely(__pyx_t_9 == ((
int)-1))) __PYX_ERR(1, 684, __pyx_L1_error)
17273 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
17282 __Pyx_TraceLine(685,0,__PYX_ERR(1, 685, __pyx_L1_error))
17283 __pyx_v_seen_ellipsis = 1;
17302 __Pyx_TraceLine(687,0,__PYX_ERR(1, 687, __pyx_L1_error))
17304 __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_slice__4);
if (unlikely(__pyx_t_9 == ((
int)-1))) __PYX_ERR(1, 687, __pyx_L1_error)
17315 __Pyx_TraceLine(688,0,__PYX_ERR(1, 688, __pyx_L1_error))
17316 __pyx_v_have_slices = 1;
17335 __Pyx_TraceLine(690,0,__PYX_ERR(1, 690, __pyx_L1_error))
17337 __pyx_t_2 = PySlice_Check(__pyx_v_item);
17338 __pyx_t_10 = ((!(__pyx_t_2 != 0)) != 0);
17341 __pyx_t_1 = __pyx_t_10;
17342 goto __pyx_L9_bool_binop_done;
17344 __pyx_t_10 = ((!(PyIndex_Check(__pyx_v_item) != 0)) != 0);
17345 __pyx_t_1 = __pyx_t_10;
17346 __pyx_L9_bool_binop_done:;
17347 if (unlikely(__pyx_t_1)) {
17356 __Pyx_TraceLine(691,0,__PYX_ERR(1, 691, __pyx_L1_error))
17357 __pyx_t_7 = __Pyx_PyString_FormatSafe(__pyx_kp_s_Cannot_index_with_type_s, ((PyObject *)Py_TYPE(__pyx_v_item)));
if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 691, __pyx_L1_error)
17358 __Pyx_GOTREF(__pyx_t_7);
17359 __pyx_t_11 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_7);
if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 691, __pyx_L1_error)
17360 __Pyx_GOTREF(__pyx_t_11);
17361 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
17362 __Pyx_Raise(__pyx_t_11, 0, 0, 0);
17363 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
17364 __PYX_ERR(1, 691, __pyx_L1_error)
17382 __Pyx_TraceLine(693,0,__PYX_ERR(1, 693, __pyx_L1_error))
17383 __pyx_t_10 = (__pyx_v_have_slices != 0);
17386 __pyx_t_1 = __pyx_t_10;
17387 goto __pyx_L11_bool_binop_done;
17389 __pyx_t_10 = PySlice_Check(__pyx_v_item);
17390 __pyx_t_2 = (__pyx_t_10 != 0);
17391 __pyx_t_1 = __pyx_t_2;
17392 __pyx_L11_bool_binop_done:;
17393 __pyx_v_have_slices = __pyx_t_1;
17402 __Pyx_TraceLine(694,0,__PYX_ERR(1, 694, __pyx_L1_error))
17403 __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_v_item);
if (unlikely(__pyx_t_9 == ((
int)-1))) __PYX_ERR(1, 694, __pyx_L1_error)
17414 __Pyx_TraceLine(681,0,__PYX_ERR(1, 681, __pyx_L1_error))
17416 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
17417 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17426 __Pyx_TraceLine(696,0,__PYX_ERR(1, 696, __pyx_L1_error))
17427 __pyx_t_5 = PyList_GET_SIZE(__pyx_v_result);
if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(1, 696, __pyx_L1_error)
17428 __pyx_v_nslices = (__pyx_v_ndim - __pyx_t_5);
17437 __Pyx_TraceLine(697,0,__PYX_ERR(1, 697, __pyx_L1_error))
17438 __pyx_t_1 = (__pyx_v_nslices != 0);
17448 __Pyx_TraceLine(698,0,__PYX_ERR(1, 698, __pyx_L1_error))
17449 __pyx_t_3 = PyList_New(1 * ((__pyx_v_nslices<0) ? 0:__pyx_v_nslices));
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 698, __pyx_L1_error)
17450 __Pyx_GOTREF(__pyx_t_3);
17451 { Py_ssize_t __pyx_temp;
17452 for (__pyx_temp=0; __pyx_temp < __pyx_v_nslices; __pyx_temp++) {
17453 __Pyx_INCREF(__pyx_slice__4);
17454 __Pyx_GIVEREF(__pyx_slice__4);
17455 PyList_SET_ITEM(__pyx_t_3, __pyx_temp, __pyx_slice__4);
17458 __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_3);
if (unlikely(__pyx_t_9 == ((
int)-1))) __PYX_ERR(1, 698, __pyx_L1_error)
17459 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17477 __Pyx_TraceLine(700,0,__PYX_ERR(1, 700, __pyx_L1_error))
17478 __Pyx_XDECREF(__pyx_r);
17479 if (!__pyx_v_have_slices) {
17481 __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_v_have_slices);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 700, __pyx_L1_error)
17482 __Pyx_GOTREF(__pyx_t_4);
17483 __pyx_t_3 = __pyx_t_4;
17485 goto __pyx_L14_bool_binop_done;
17487 __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_nslices);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 700, __pyx_L1_error)
17488 __Pyx_GOTREF(__pyx_t_4);
17489 __pyx_t_3 = __pyx_t_4;
17491 __pyx_L14_bool_binop_done:;
17492 __pyx_t_4 = PyList_AsTuple(__pyx_v_result);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 700, __pyx_L1_error)
17493 __Pyx_GOTREF(__pyx_t_4);
17494 __pyx_t_11 = PyTuple_New(2);
if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 700, __pyx_L1_error)
17495 __Pyx_GOTREF(__pyx_t_11);
17496 __Pyx_GIVEREF(__pyx_t_3);
17497 PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_3);
17498 __Pyx_GIVEREF(__pyx_t_4);
17499 PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_4);
17502 __pyx_r = ((PyObject*)__pyx_t_11);
17516 __Pyx_XDECREF(__pyx_t_3);
17517 __Pyx_XDECREF(__pyx_t_4);
17518 __Pyx_XDECREF(__pyx_t_7);
17519 __Pyx_XDECREF(__pyx_t_11);
17520 __Pyx_AddTraceback(
"View.MemoryView._unellipsify", __pyx_clineno, __pyx_lineno, __pyx_filename);
17523 __Pyx_XDECREF(__pyx_v_tup);
17524 __Pyx_XDECREF(__pyx_v_result);
17525 __Pyx_XDECREF(__pyx_v_idx);
17526 __Pyx_XDECREF(__pyx_v_item);
17527 __Pyx_XGIVEREF(__pyx_r);
17528 __Pyx_TraceReturn(__pyx_r, 0);
17529 __Pyx_RefNannyFinishContext();
17541 static PyObject *assert_direct_dimensions(Py_ssize_t *__pyx_v_suboffsets,
int __pyx_v_ndim) {
17542 Py_ssize_t __pyx_v_suboffset;
17543 PyObject *__pyx_r = NULL;
17544 __Pyx_TraceDeclarations
17545 __Pyx_RefNannyDeclarations
17546 Py_ssize_t *__pyx_t_1;
17547 Py_ssize_t *__pyx_t_2;
17548 Py_ssize_t *__pyx_t_3;
17550 PyObject *__pyx_t_5 = NULL;
17551 int __pyx_lineno = 0;
17552 const char *__pyx_filename = NULL;
17553 int __pyx_clineno = 0;
17554 __Pyx_RefNannySetupContext(
"assert_direct_dimensions", 0);
17555 __Pyx_TraceCall(
"assert_direct_dimensions", __pyx_f[1], 702, 0, __PYX_ERR(1, 702, __pyx_L1_error));
17564 __Pyx_TraceLine(703,0,__PYX_ERR(1, 703, __pyx_L1_error))
17565 __pyx_t_2 = (__pyx_v_suboffsets + __pyx_v_ndim);
17566 for (__pyx_t_3 = __pyx_v_suboffsets; __pyx_t_3 < __pyx_t_2; __pyx_t_3++) {
17567 __pyx_t_1 = __pyx_t_3;
17568 __pyx_v_suboffset = (__pyx_t_1[0]);
17577 __Pyx_TraceLine(704,0,__PYX_ERR(1, 704, __pyx_L1_error))
17578 __pyx_t_4 = ((__pyx_v_suboffset >= 0) != 0);
17579 if (unlikely(__pyx_t_4)) {
17588 __Pyx_TraceLine(705,0,__PYX_ERR(1, 705, __pyx_L1_error))
17589 __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__22, NULL);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 705, __pyx_L1_error)
17590 __Pyx_GOTREF(__pyx_t_5);
17591 __Pyx_Raise(__pyx_t_5, 0, 0, 0);
17592 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
17593 __PYX_ERR(1, 705, __pyx_L1_error)
17614 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
17617 __Pyx_XDECREF(__pyx_t_5);
17618 __Pyx_AddTraceback(
"View.MemoryView.assert_direct_dimensions", __pyx_clineno, __pyx_lineno, __pyx_filename);
17621 __Pyx_XGIVEREF(__pyx_r);
17622 __Pyx_TraceReturn(__pyx_r, 0);
17623 __Pyx_RefNannyFinishContext();
17635 static struct __pyx_memoryview_obj *__pyx_memview_slice(
struct __pyx_memoryview_obj *__pyx_v_memview, PyObject *__pyx_v_indices) {
17636 int __pyx_v_new_ndim;
17637 int __pyx_v_suboffset_dim;
17639 __Pyx_memviewslice __pyx_v_src;
17640 __Pyx_memviewslice __pyx_v_dst;
17641 __Pyx_memviewslice *__pyx_v_p_src;
17642 struct __pyx_memoryviewslice_obj *__pyx_v_memviewsliceobj = 0;
17643 __Pyx_memviewslice *__pyx_v_p_dst;
17644 int *__pyx_v_p_suboffset_dim;
17645 Py_ssize_t __pyx_v_start;
17646 Py_ssize_t __pyx_v_stop;
17647 Py_ssize_t __pyx_v_step;
17648 int __pyx_v_have_start;
17649 int __pyx_v_have_stop;
17650 int __pyx_v_have_step;
17651 PyObject *__pyx_v_index = NULL;
17652 struct __pyx_memoryview_obj *__pyx_r = NULL;
17653 __Pyx_TraceDeclarations
17654 __Pyx_RefNannyDeclarations
17657 PyObject *__pyx_t_3 = NULL;
17658 struct __pyx_memoryview_obj *__pyx_t_4;
17661 Py_ssize_t __pyx_t_7;
17662 PyObject *(*__pyx_t_8)(PyObject *);
17663 PyObject *__pyx_t_9 = NULL;
17664 Py_ssize_t __pyx_t_10;
17666 Py_ssize_t __pyx_t_12;
17667 int __pyx_lineno = 0;
17668 const char *__pyx_filename = NULL;
17669 int __pyx_clineno = 0;
17670 __Pyx_RefNannySetupContext(
"memview_slice", 0);
17671 __Pyx_TraceCall(
"memview_slice", __pyx_f[1], 712, 0, __PYX_ERR(1, 712, __pyx_L1_error));
17680 __Pyx_TraceLine(713,0,__PYX_ERR(1, 713, __pyx_L1_error))
17681 __pyx_v_new_ndim = 0;
17682 __pyx_v_suboffset_dim = -1;
17691 __Pyx_TraceLine(720,0,__PYX_ERR(1, 720, __pyx_L1_error))
17692 (void)(memset((&__pyx_v_dst), 0, (
sizeof(__pyx_v_dst))));
17701 __Pyx_TraceLine(724,0,__PYX_ERR(1, 724, __pyx_L1_error))
17702 #ifndef CYTHON_WITHOUT_ASSERTIONS
17703 if (unlikely(__pyx_assertions_enabled())) {
17704 if (unlikely(!((__pyx_v_memview->view.ndim > 0) != 0))) {
17705 PyErr_SetNone(PyExc_AssertionError);
17706 __PYX_ERR(1, 724, __pyx_L1_error)
17718 __Pyx_TraceLine(726,0,__PYX_ERR(1, 726, __pyx_L1_error))
17719 __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
17720 __pyx_t_2 = (__pyx_t_1 != 0);
17730 __Pyx_TraceLine(727,0,__PYX_ERR(1, 727, __pyx_L1_error))
17731 if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(1, 727, __pyx_L1_error)
17732 __pyx_t_3 = ((PyObject *)__pyx_v_memview);
17733 __Pyx_INCREF(__pyx_t_3);
17734 __pyx_v_memviewsliceobj = ((
struct __pyx_memoryviewslice_obj *)__pyx_t_3);
17744 __Pyx_TraceLine(728,0,__PYX_ERR(1, 728, __pyx_L1_error))
17745 __pyx_v_p_src = (&__pyx_v_memviewsliceobj->from_slice);
17764 __Pyx_TraceLine(730,0,__PYX_ERR(1, 730, __pyx_L1_error))
17766 __pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_src));
17775 __Pyx_TraceLine(731,0,__PYX_ERR(1, 731, __pyx_L1_error))
17776 __pyx_v_p_src = (&__pyx_v_src);
17787 __Pyx_TraceLine(737,0,__PYX_ERR(1, 737, __pyx_L1_error))
17788 __pyx_t_4 = __pyx_v_p_src->memview;
17789 __pyx_v_dst.memview = __pyx_t_4;
17798 __Pyx_TraceLine(738,0,__PYX_ERR(1, 738, __pyx_L1_error))
17799 __pyx_t_5 = __pyx_v_p_src->data;
17800 __pyx_v_dst.data = __pyx_t_5;
17809 __Pyx_TraceLine(743,0,__PYX_ERR(1, 743, __pyx_L1_error))
17810 __pyx_v_p_dst = (&__pyx_v_dst);
17819 __Pyx_TraceLine(744,0,__PYX_ERR(1, 744, __pyx_L1_error))
17820 __pyx_v_p_suboffset_dim = (&__pyx_v_suboffset_dim);
17829 __Pyx_TraceLine(748,0,__PYX_ERR(1, 748, __pyx_L1_error))
17831 if (likely(PyList_CheckExact(__pyx_v_indices)) || PyTuple_CheckExact(__pyx_v_indices)) {
17832 __pyx_t_3 = __pyx_v_indices; __Pyx_INCREF(__pyx_t_3); __pyx_t_7 = 0;
17835 __pyx_t_7 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_indices);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 748, __pyx_L1_error)
17836 __Pyx_GOTREF(__pyx_t_3);
17837 __pyx_t_8 = Py_TYPE(__pyx_t_3)->tp_iternext;
if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 748, __pyx_L1_error)
17840 if (likely(!__pyx_t_8)) {
17841 if (likely(PyList_CheckExact(__pyx_t_3))) {
17842 if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_3))
break;
17843 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
17844 __pyx_t_9 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++;
if (unlikely(0 < 0)) __PYX_ERR(1, 748, __pyx_L1_error)
17846 __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++;
if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 748, __pyx_L1_error)
17847 __Pyx_GOTREF(__pyx_t_9);
17850 if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_3))
break;
17851 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
17852 __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++;
if (unlikely(0 < 0)) __PYX_ERR(1, 748, __pyx_L1_error)
17854 __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++;
if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 748, __pyx_L1_error)
17855 __Pyx_GOTREF(__pyx_t_9);
17859 __pyx_t_9 = __pyx_t_8(__pyx_t_3);
17860 if (unlikely(!__pyx_t_9)) {
17861 PyObject* exc_type = PyErr_Occurred();
17863 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
17864 else __PYX_ERR(1, 748, __pyx_L1_error)
17868 __Pyx_GOTREF(__pyx_t_9);
17870 __Pyx_XDECREF_SET(__pyx_v_index, __pyx_t_9);
17872 __pyx_v_dim = __pyx_t_6;
17873 __pyx_t_6 = (__pyx_t_6 + 1);
17882 __Pyx_TraceLine(749,0,__PYX_ERR(1, 749, __pyx_L1_error))
17883 __pyx_t_2 = (PyIndex_Check(__pyx_v_index) != 0);
17893 __Pyx_TraceLine(753,0,__PYX_ERR(1, 753, __pyx_L1_error))
17894 __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_v_index);
if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 753, __pyx_L1_error)
17903 __Pyx_TraceLine(750,0,__PYX_ERR(1, 750, __pyx_L1_error))
17904 __pyx_t_11 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_t_10, 0, 0, 0, 0, 0, 0);
if (unlikely(__pyx_t_11 == ((
int)-1))) __PYX_ERR(1, 750, __pyx_L1_error)
17923 __Pyx_TraceLine(756,0,__PYX_ERR(1, 756, __pyx_L1_error))
17924 __pyx_t_2 = (__pyx_v_index == Py_None);
17925 __pyx_t_1 = (__pyx_t_2 != 0);
17935 __Pyx_TraceLine(757,0,__PYX_ERR(1, 757, __pyx_L1_error))
17936 (__pyx_v_p_dst->shape[__pyx_v_new_ndim]) = 1;
17945 __Pyx_TraceLine(758,0,__PYX_ERR(1, 758, __pyx_L1_error))
17946 (__pyx_v_p_dst->strides[__pyx_v_new_ndim]) = 0;
17955 __Pyx_TraceLine(759,0,__PYX_ERR(1, 759, __pyx_L1_error))
17956 (__pyx_v_p_dst->suboffsets[__pyx_v_new_ndim]) = -1L;
17965 __Pyx_TraceLine(760,0,__PYX_ERR(1, 760, __pyx_L1_error))
17966 __pyx_v_new_ndim = (__pyx_v_new_ndim + 1);
17985 __Pyx_TraceLine(762,0,__PYX_ERR(1, 762, __pyx_L1_error))
17987 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start);
if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 762, __pyx_L1_error)
17988 __Pyx_GOTREF(__pyx_t_9);
17989 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9);
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 762, __pyx_L1_error)
17991 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
17993 __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9);
if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 762, __pyx_L1_error)
17994 __pyx_t_10 = __pyx_t_12;
17995 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
17996 goto __pyx_L7_bool_binop_done;
17999 __pyx_L7_bool_binop_done:;
18000 __pyx_v_start = __pyx_t_10;
18009 __Pyx_TraceLine(763,0,__PYX_ERR(1, 763, __pyx_L1_error))
18010 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop);
if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 763, __pyx_L1_error)
18011 __Pyx_GOTREF(__pyx_t_9);
18012 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9);
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 763, __pyx_L1_error)
18014 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
18016 __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9);
if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 763, __pyx_L1_error)
18017 __pyx_t_10 = __pyx_t_12;
18018 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
18019 goto __pyx_L9_bool_binop_done;
18022 __pyx_L9_bool_binop_done:;
18023 __pyx_v_stop = __pyx_t_10;
18032 __Pyx_TraceLine(764,0,__PYX_ERR(1, 764, __pyx_L1_error))
18033 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step);
if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 764, __pyx_L1_error)
18034 __Pyx_GOTREF(__pyx_t_9);
18035 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9);
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 764, __pyx_L1_error)
18037 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
18039 __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9);
if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 764, __pyx_L1_error)
18040 __pyx_t_10 = __pyx_t_12;
18041 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
18042 goto __pyx_L11_bool_binop_done;
18045 __pyx_L11_bool_binop_done:;
18046 __pyx_v_step = __pyx_t_10;
18055 __Pyx_TraceLine(766,0,__PYX_ERR(1, 766, __pyx_L1_error))
18056 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start);
if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 766, __pyx_L1_error)
18057 __Pyx_GOTREF(__pyx_t_9);
18058 __pyx_t_1 = (__pyx_t_9 != Py_None);
18059 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
18060 __pyx_v_have_start = __pyx_t_1;
18069 __Pyx_TraceLine(767,0,__PYX_ERR(1, 767, __pyx_L1_error))
18070 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop);
if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 767, __pyx_L1_error)
18071 __Pyx_GOTREF(__pyx_t_9);
18072 __pyx_t_1 = (__pyx_t_9 != Py_None);
18073 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
18074 __pyx_v_have_stop = __pyx_t_1;
18083 __Pyx_TraceLine(768,0,__PYX_ERR(1, 768, __pyx_L1_error))
18084 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step);
if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 768, __pyx_L1_error)
18085 __Pyx_GOTREF(__pyx_t_9);
18086 __pyx_t_1 = (__pyx_t_9 != Py_None);
18087 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
18088 __pyx_v_have_step = __pyx_t_1;
18097 __Pyx_TraceLine(770,0,__PYX_ERR(1, 770, __pyx_L1_error))
18098 __pyx_t_11 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_v_start, __pyx_v_stop, __pyx_v_step, __pyx_v_have_start, __pyx_v_have_stop, __pyx_v_have_step, 1);
if (unlikely(__pyx_t_11 == ((
int)-1))) __PYX_ERR(1, 770, __pyx_L1_error)
18107 __Pyx_TraceLine(776,0,__PYX_ERR(1, 776, __pyx_L1_error))
18108 __pyx_v_new_ndim = (__pyx_v_new_ndim + 1);
18119 __Pyx_TraceLine(748,0,__PYX_ERR(1, 748, __pyx_L1_error))
18121 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
18130 __Pyx_TraceLine(778,0,__PYX_ERR(1, 778, __pyx_L1_error))
18131 __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
18132 __pyx_t_2 = (__pyx_t_1 != 0);
18142 __Pyx_TraceLine(779,0,__PYX_ERR(1, 779, __pyx_L1_error))
18143 __Pyx_XDECREF(((PyObject *)__pyx_r));
18152 __Pyx_TraceLine(780,0,__PYX_ERR(1, 780, __pyx_L1_error))
18153 if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError(
"memviewsliceobj"); __PYX_ERR(1, 780, __pyx_L1_error) }
18162 __Pyx_TraceLine(781,0,__PYX_ERR(1, 781, __pyx_L1_error))
18163 if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError(
"memviewsliceobj"); __PYX_ERR(1, 781, __pyx_L1_error) }
18172 __Pyx_TraceLine(779,0,__PYX_ERR(1, 779, __pyx_L1_error))
18173 __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, __pyx_v_memviewsliceobj->to_object_func, __pyx_v_memviewsliceobj->to_dtype_func, __pyx_v_memview->dtype_is_object);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 779, __pyx_L1_error)
18174 __Pyx_GOTREF(__pyx_t_3);
18175 if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(1, 779, __pyx_L1_error)
18176 __pyx_r = ((
struct __pyx_memoryview_obj *)__pyx_t_3);
18196 __Pyx_TraceLine(784,0,__PYX_ERR(1, 784, __pyx_L1_error))
18198 __Pyx_XDECREF(((PyObject *)__pyx_r));
18207 __Pyx_TraceLine(785,0,__PYX_ERR(1, 785, __pyx_L1_error))
18208 __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, NULL, NULL, __pyx_v_memview->dtype_is_object);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 784, __pyx_L1_error)
18209 __Pyx_GOTREF(__pyx_t_3);
18218 __Pyx_TraceLine(784,0,__PYX_ERR(1, 784, __pyx_L1_error))
18219 if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(1, 784, __pyx_L1_error)
18220 __pyx_r = ((
struct __pyx_memoryview_obj *)__pyx_t_3);
18235 __Pyx_XDECREF(__pyx_t_3);
18236 __Pyx_XDECREF(__pyx_t_9);
18237 __Pyx_AddTraceback(
"View.MemoryView.memview_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
18240 __Pyx_XDECREF((PyObject *)__pyx_v_memviewsliceobj);
18241 __Pyx_XDECREF(__pyx_v_index);
18242 __Pyx_XGIVEREF((PyObject *)__pyx_r);
18243 __Pyx_TraceReturn(__pyx_r, 0);
18244 __Pyx_RefNannyFinishContext();
18256 static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, Py_ssize_t __pyx_v_shape, Py_ssize_t __pyx_v_stride, Py_ssize_t __pyx_v_suboffset,
int __pyx_v_dim,
int __pyx_v_new_ndim,
int *__pyx_v_suboffset_dim, Py_ssize_t __pyx_v_start, Py_ssize_t __pyx_v_stop, Py_ssize_t __pyx_v_step,
int __pyx_v_have_start,
int __pyx_v_have_stop,
int __pyx_v_have_step,
int __pyx_v_is_slice) {
18257 Py_ssize_t __pyx_v_new_shape;
18258 int __pyx_v_negative_step;
18260 __Pyx_TraceDeclarations
18264 int __pyx_lineno = 0;
18265 const char *__pyx_filename = NULL;
18266 int __pyx_clineno = 0;
18267 __Pyx_TraceCall(
"slice_memviewslice", __pyx_f[1], 809, 1, __PYX_ERR(1, 809, __pyx_L1_error));
18276 __Pyx_TraceLine(829,1,__PYX_ERR(1, 829, __pyx_L1_error))
18277 __pyx_t_1 = ((!(__pyx_v_is_slice != 0)) != 0);
18287 __Pyx_TraceLine(831,1,__PYX_ERR(1, 831, __pyx_L1_error))
18288 __pyx_t_1 = ((__pyx_v_start < 0) != 0);
18298 __Pyx_TraceLine(832,1,__PYX_ERR(1, 832, __pyx_L1_error))
18299 __pyx_v_start = (__pyx_v_start + __pyx_v_shape);
18317 __Pyx_TraceLine(833,1,__PYX_ERR(1, 833, __pyx_L1_error))
18318 __pyx_t_1 = (0 <= __pyx_v_start);
18320 __pyx_t_1 = (__pyx_v_start < __pyx_v_shape);
18322 __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
18332 __Pyx_TraceLine(834,1,__PYX_ERR(1, 834, __pyx_L1_error))
18333 __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, ((
char *)
"Index out of bounds (axis %d)"), __pyx_v_dim);
if (unlikely(__pyx_t_3 == ((
int)-1))) __PYX_ERR(1, 834, __pyx_L1_error)
18361 __Pyx_TraceLine(837,1,__PYX_ERR(1, 837, __pyx_L1_error))
18363 __pyx_t_1 = ((__pyx_v_have_step != 0) != 0);
18366 __pyx_t_2 = __pyx_t_1;
18367 goto __pyx_L6_bool_binop_done;
18369 __pyx_t_1 = ((__pyx_v_step < 0) != 0);
18370 __pyx_t_2 = __pyx_t_1;
18371 __pyx_L6_bool_binop_done:;
18372 __pyx_v_negative_step = __pyx_t_2;
18381 __Pyx_TraceLine(839,1,__PYX_ERR(1, 839, __pyx_L1_error))
18382 __pyx_t_1 = (__pyx_v_have_step != 0);
18385 __pyx_t_2 = __pyx_t_1;
18386 goto __pyx_L9_bool_binop_done;
18388 __pyx_t_1 = ((__pyx_v_step == 0) != 0);
18389 __pyx_t_2 = __pyx_t_1;
18390 __pyx_L9_bool_binop_done:;
18400 __Pyx_TraceLine(840,1,__PYX_ERR(1, 840, __pyx_L1_error))
18401 __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, ((
char *)
"Step may not be zero (axis %d)"), __pyx_v_dim);
if (unlikely(__pyx_t_3 == ((
int)-1))) __PYX_ERR(1, 840, __pyx_L1_error)
18419 __Pyx_TraceLine(843,1,__PYX_ERR(1, 843, __pyx_L1_error))
18420 __pyx_t_2 = (__pyx_v_have_start != 0);
18430 __Pyx_TraceLine(844,1,__PYX_ERR(1, 844, __pyx_L1_error))
18431 __pyx_t_2 = ((__pyx_v_start < 0) != 0);
18441 __Pyx_TraceLine(845,1,__PYX_ERR(1, 845, __pyx_L1_error))
18442 __pyx_v_start = (__pyx_v_start + __pyx_v_shape);
18451 __Pyx_TraceLine(846,1,__PYX_ERR(1, 846, __pyx_L1_error))
18452 __pyx_t_2 = ((__pyx_v_start < 0) != 0);
18462 __Pyx_TraceLine(847,1,__PYX_ERR(1, 847, __pyx_L1_error))
18491 __Pyx_TraceLine(848,1,__PYX_ERR(1, 848, __pyx_L1_error))
18492 __pyx_t_2 = ((__pyx_v_start >= __pyx_v_shape) != 0);
18502 __Pyx_TraceLine(849,1,__PYX_ERR(1, 849, __pyx_L1_error))
18503 __pyx_t_2 = (__pyx_v_negative_step != 0);
18513 __Pyx_TraceLine(850,1,__PYX_ERR(1, 850, __pyx_L1_error))
18514 __pyx_v_start = (__pyx_v_shape - 1);
18533 __Pyx_TraceLine(852,1,__PYX_ERR(1, 852, __pyx_L1_error))
18535 __pyx_v_start = __pyx_v_shape;
18566 __Pyx_TraceLine(854,1,__PYX_ERR(1, 854, __pyx_L1_error))
18568 __pyx_t_2 = (__pyx_v_negative_step != 0);
18578 __Pyx_TraceLine(855,1,__PYX_ERR(1, 855, __pyx_L1_error))
18579 __pyx_v_start = (__pyx_v_shape - 1);
18598 __Pyx_TraceLine(857,1,__PYX_ERR(1, 857, __pyx_L1_error))
18613 __Pyx_TraceLine(859,1,__PYX_ERR(1, 859, __pyx_L1_error))
18614 __pyx_t_2 = (__pyx_v_have_stop != 0);
18624 __Pyx_TraceLine(860,1,__PYX_ERR(1, 860, __pyx_L1_error))
18625 __pyx_t_2 = ((__pyx_v_stop < 0) != 0);
18635 __Pyx_TraceLine(861,1,__PYX_ERR(1, 861, __pyx_L1_error))
18636 __pyx_v_stop = (__pyx_v_stop + __pyx_v_shape);
18645 __Pyx_TraceLine(862,1,__PYX_ERR(1, 862, __pyx_L1_error))
18646 __pyx_t_2 = ((__pyx_v_stop < 0) != 0);
18656 __Pyx_TraceLine(863,1,__PYX_ERR(1, 863, __pyx_L1_error))
18685 __Pyx_TraceLine(864,1,__PYX_ERR(1, 864, __pyx_L1_error))
18686 __pyx_t_2 = ((__pyx_v_stop > __pyx_v_shape) != 0);
18696 __Pyx_TraceLine(865,1,__PYX_ERR(1, 865, __pyx_L1_error))
18697 __pyx_v_stop = __pyx_v_shape;
18726 __Pyx_TraceLine(867,1,__PYX_ERR(1, 867, __pyx_L1_error))
18728 __pyx_t_2 = (__pyx_v_negative_step != 0);
18738 __Pyx_TraceLine(868,1,__PYX_ERR(1, 868, __pyx_L1_error))
18739 __pyx_v_stop = -1L;
18758 __Pyx_TraceLine(870,1,__PYX_ERR(1, 870, __pyx_L1_error))
18760 __pyx_v_stop = __pyx_v_shape;
18773 __Pyx_TraceLine(872,1,__PYX_ERR(1, 872, __pyx_L1_error))
18774 __pyx_t_2 = ((!(__pyx_v_have_step != 0)) != 0);
18784 __Pyx_TraceLine(873,1,__PYX_ERR(1, 873, __pyx_L1_error))
18803 __pyx_v_new_shape = ((__pyx_v_stop - __pyx_v_start) / __pyx_v_step);
18812 __pyx_t_2 = (((__pyx_v_stop - __pyx_v_start) - (__pyx_v_step * __pyx_v_new_shape)) != 0);
18822 __pyx_v_new_shape = (__pyx_v_new_shape + 1);
18840 __Pyx_TraceLine(882,1,__PYX_ERR(1, 882, __pyx_L1_error))
18841 __pyx_t_2 = ((__pyx_v_new_shape < 0) != 0);
18851 __Pyx_TraceLine(883,1,__PYX_ERR(1, 883, __pyx_L1_error))
18852 __pyx_v_new_shape = 0;
18870 __Pyx_TraceLine(886,1,__PYX_ERR(1, 886, __pyx_L1_error))
18871 (__pyx_v_dst->strides[__pyx_v_new_ndim]) = (__pyx_v_stride * __pyx_v_step);
18880 __Pyx_TraceLine(887,1,__PYX_ERR(1, 887, __pyx_L1_error))
18881 (__pyx_v_dst->shape[__pyx_v_new_ndim]) = __pyx_v_new_shape;
18890 __Pyx_TraceLine(888,1,__PYX_ERR(1, 888, __pyx_L1_error))
18891 (__pyx_v_dst->suboffsets[__pyx_v_new_ndim]) = __pyx_v_suboffset;
18902 __Pyx_TraceLine(891,1,__PYX_ERR(1, 891, __pyx_L1_error))
18903 __pyx_t_2 = (((__pyx_v_suboffset_dim[0]) < 0) != 0);
18913 __Pyx_TraceLine(892,1,__PYX_ERR(1, 892, __pyx_L1_error))
18914 __pyx_v_dst->data = (__pyx_v_dst->data + (__pyx_v_start * __pyx_v_stride));
18933 __Pyx_TraceLine(894,1,__PYX_ERR(1, 894, __pyx_L1_error))
18935 __pyx_t_3 = (__pyx_v_suboffset_dim[0]);
18936 (__pyx_v_dst->suboffsets[__pyx_t_3]) = ((__pyx_v_dst->suboffsets[__pyx_t_3]) + (__pyx_v_start * __pyx_v_stride));
18947 __Pyx_TraceLine(896,1,__PYX_ERR(1, 896, __pyx_L1_error))
18948 __pyx_t_2 = ((__pyx_v_suboffset >= 0) != 0);
18958 __Pyx_TraceLine(897,1,__PYX_ERR(1, 897, __pyx_L1_error))
18959 __pyx_t_2 = ((!(__pyx_v_is_slice != 0)) != 0);
18969 __Pyx_TraceLine(898,1,__PYX_ERR(1, 898, __pyx_L1_error))
18970 __pyx_t_2 = ((__pyx_v_new_ndim == 0) != 0);
18980 __Pyx_TraceLine(899,1,__PYX_ERR(1, 899, __pyx_L1_error))
18981 __pyx_v_dst->data = ((((
char **)__pyx_v_dst->data)[0]) + __pyx_v_suboffset);
19000 __Pyx_TraceLine(901,1,__PYX_ERR(1, 901, __pyx_L1_error))
19010 __Pyx_TraceLine(902,1,__PYX_ERR(1, 902, __pyx_L1_error))
19011 __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, ((
char *)
"All dimensions preceding dimension %d must be indexed and not sliced"), __pyx_v_dim);
if (unlikely(__pyx_t_3 == ((
int)-1))) __PYX_ERR(1, 901, __pyx_L1_error)
19032 __Pyx_TraceLine(904,1,__PYX_ERR(1, 904, __pyx_L1_error))
19034 (__pyx_v_suboffset_dim[0]) = __pyx_v_new_ndim;
19054 __Pyx_TraceLine(906,1,__PYX_ERR(1, 906, __pyx_L1_error))
19070 PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
19072 __Pyx_AddTraceback(
"View.MemoryView.slice_memviewslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
19074 __Pyx_PyGILState_Release(__pyx_gilstate_save);
19079 __Pyx_TraceReturn(Py_None, 1);
19091 static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view,
char *__pyx_v_bufp, Py_ssize_t __pyx_v_index, Py_ssize_t __pyx_v_dim) {
19092 Py_ssize_t __pyx_v_shape;
19093 Py_ssize_t __pyx_v_stride;
19094 Py_ssize_t __pyx_v_suboffset;
19095 Py_ssize_t __pyx_v_itemsize;
19096 char *__pyx_v_resultp;
19098 __Pyx_TraceDeclarations
19099 __Pyx_RefNannyDeclarations
19100 Py_ssize_t __pyx_t_1;
19102 PyObject *__pyx_t_3 = NULL;
19103 PyObject *__pyx_t_4 = NULL;
19104 int __pyx_lineno = 0;
19105 const char *__pyx_filename = NULL;
19106 int __pyx_clineno = 0;
19107 __Pyx_RefNannySetupContext(
"pybuffer_index", 0);
19108 __Pyx_TraceCall(
"pybuffer_index", __pyx_f[1], 912, 0, __PYX_ERR(1, 912, __pyx_L1_error));
19117 __Pyx_TraceLine(914,0,__PYX_ERR(1, 914, __pyx_L1_error))
19118 __pyx_v_suboffset = -1L;
19127 __Pyx_TraceLine(915,0,__PYX_ERR(1, 915, __pyx_L1_error))
19128 __pyx_t_1 = __pyx_v_view->itemsize;
19129 __pyx_v_itemsize = __pyx_t_1;
19138 __Pyx_TraceLine(918,0,__PYX_ERR(1, 918, __pyx_L1_error))
19139 __pyx_t_2 = ((__pyx_v_view->ndim == 0) != 0);
19149 __Pyx_TraceLine(919,0,__PYX_ERR(1, 919, __pyx_L1_error))
19150 if (unlikely(__pyx_v_itemsize == 0)) {
19151 PyErr_SetString(PyExc_ZeroDivisionError,
"integer division or modulo by zero");
19152 __PYX_ERR(1, 919, __pyx_L1_error)
19154 else if (
sizeof(Py_ssize_t) ==
sizeof(
long) && (!(((Py_ssize_t)-1) > 0)) && unlikely(__pyx_v_itemsize == (Py_ssize_t)-1) && unlikely(UNARY_NEG_WOULD_OVERFLOW(__pyx_v_view->len))) {
19155 PyErr_SetString(PyExc_OverflowError,
"value too large to perform division");
19156 __PYX_ERR(1, 919, __pyx_L1_error)
19158 __pyx_v_shape = (__pyx_v_view->len / __pyx_v_itemsize);
19167 __Pyx_TraceLine(920,0,__PYX_ERR(1, 920, __pyx_L1_error))
19168 __pyx_v_stride = __pyx_v_itemsize;
19187 __Pyx_TraceLine(922,0,__PYX_ERR(1, 922, __pyx_L1_error))
19189 __pyx_v_shape = (__pyx_v_view->shape[__pyx_v_dim]);
19198 __Pyx_TraceLine(923,0,__PYX_ERR(1, 923, __pyx_L1_error))
19199 __pyx_v_stride = (__pyx_v_view->strides[__pyx_v_dim]);
19208 __Pyx_TraceLine(924,0,__PYX_ERR(1, 924, __pyx_L1_error))
19209 __pyx_t_2 = ((__pyx_v_view->suboffsets != NULL) != 0);
19219 __Pyx_TraceLine(925,0,__PYX_ERR(1, 925, __pyx_L1_error))
19220 __pyx_v_suboffset = (__pyx_v_view->suboffsets[__pyx_v_dim]);
19240 __Pyx_TraceLine(927,0,__PYX_ERR(1, 927, __pyx_L1_error))
19241 __pyx_t_2 = ((__pyx_v_index < 0) != 0);
19251 __Pyx_TraceLine(928,0,__PYX_ERR(1, 928, __pyx_L1_error))
19252 __pyx_v_index = (__pyx_v_index + (__pyx_v_view->shape[__pyx_v_dim]));
19261 __Pyx_TraceLine(929,0,__PYX_ERR(1, 929, __pyx_L1_error))
19262 __pyx_t_2 = ((__pyx_v_index < 0) != 0);
19263 if (unlikely(__pyx_t_2)) {
19272 __Pyx_TraceLine(930,0,__PYX_ERR(1, 930, __pyx_L1_error))
19273 __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_dim);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 930, __pyx_L1_error)
19274 __Pyx_GOTREF(__pyx_t_3);
19275 __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_t_3);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 930, __pyx_L1_error)
19276 __Pyx_GOTREF(__pyx_t_4);
19277 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
19278 __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IndexError, __pyx_t_4);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 930, __pyx_L1_error)
19279 __Pyx_GOTREF(__pyx_t_3);
19280 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
19281 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
19282 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
19283 __PYX_ERR(1, 930, __pyx_L1_error)
19310 __Pyx_TraceLine(932,0,__PYX_ERR(1, 932, __pyx_L1_error))
19311 __pyx_t_2 = ((__pyx_v_index >= __pyx_v_shape) != 0);
19312 if (unlikely(__pyx_t_2)) {
19321 __Pyx_TraceLine(933,0,__PYX_ERR(1, 933, __pyx_L1_error))
19322 __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_dim);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 933, __pyx_L1_error)
19323 __Pyx_GOTREF(__pyx_t_3);
19324 __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_t_3);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 933, __pyx_L1_error)
19325 __Pyx_GOTREF(__pyx_t_4);
19326 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
19327 __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IndexError, __pyx_t_4);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 933, __pyx_L1_error)
19328 __Pyx_GOTREF(__pyx_t_3);
19329 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
19330 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
19331 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
19332 __PYX_ERR(1, 933, __pyx_L1_error)
19350 __Pyx_TraceLine(935,0,__PYX_ERR(1, 935, __pyx_L1_error))
19351 __pyx_v_resultp = (__pyx_v_bufp + (__pyx_v_index * __pyx_v_stride));
19360 __Pyx_TraceLine(936,0,__PYX_ERR(1, 936, __pyx_L1_error))
19361 __pyx_t_2 = ((__pyx_v_suboffset >= 0) != 0);
19371 __Pyx_TraceLine(937,0,__PYX_ERR(1, 937, __pyx_L1_error))
19372 __pyx_v_resultp = ((((
char **)__pyx_v_resultp)[0]) + __pyx_v_suboffset);
19390 __Pyx_TraceLine(939,0,__PYX_ERR(1, 939, __pyx_L1_error))
19391 __pyx_r = __pyx_v_resultp;
19404 __Pyx_XDECREF(__pyx_t_3);
19405 __Pyx_XDECREF(__pyx_t_4);
19406 __Pyx_AddTraceback(
"View.MemoryView.pybuffer_index", __pyx_clineno, __pyx_lineno, __pyx_filename);
19409 __Pyx_TraceReturn(Py_None, 0);
19410 __Pyx_RefNannyFinishContext();
19422 static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) {
19424 Py_ssize_t *__pyx_v_shape;
19425 Py_ssize_t *__pyx_v_strides;
19429 __Pyx_TraceDeclarations
19431 Py_ssize_t *__pyx_t_2;
19434 Py_ssize_t __pyx_t_5;
19435 Py_ssize_t __pyx_t_6;
19439 int __pyx_lineno = 0;
19440 const char *__pyx_filename = NULL;
19441 int __pyx_clineno = 0;
19442 __Pyx_TraceCall(
"transpose_memslice", __pyx_f[1], 945, 1, __PYX_ERR(1, 945, __pyx_L1_error));
19451 __Pyx_TraceLine(946,1,__PYX_ERR(1, 946, __pyx_L1_error))
19452 __pyx_t_1 = __pyx_v_memslice->memview->view.ndim;
19453 __pyx_v_ndim = __pyx_t_1;
19462 __Pyx_TraceLine(948,1,__PYX_ERR(1, 948, __pyx_L1_error))
19463 __pyx_t_2 = __pyx_v_memslice->shape;
19464 __pyx_v_shape = __pyx_t_2;
19473 __Pyx_TraceLine(949,1,__PYX_ERR(1, 949, __pyx_L1_error))
19474 __pyx_t_2 = __pyx_v_memslice->strides;
19475 __pyx_v_strides = __pyx_t_2;
19484 __Pyx_TraceLine(953,1,__PYX_ERR(1, 953, __pyx_L1_error))
19485 __pyx_t_3 = (__pyx_v_ndim / 2);
19486 __pyx_t_4 = __pyx_t_3;
19487 for (__pyx_t_1 = 0; __pyx_t_1 < __pyx_t_4; __pyx_t_1+=1) {
19488 __pyx_v_i = __pyx_t_1;
19497 __Pyx_TraceLine(954,1,__PYX_ERR(1, 954, __pyx_L1_error))
19498 __pyx_v_j = ((__pyx_v_ndim - 1) - __pyx_v_i);
19507 __Pyx_TraceLine(955,1,__PYX_ERR(1, 955, __pyx_L1_error))
19508 __pyx_t_5 = (__pyx_v_strides[__pyx_v_j]);
19509 __pyx_t_6 = (__pyx_v_strides[__pyx_v_i]);
19510 (__pyx_v_strides[__pyx_v_i]) = __pyx_t_5;
19511 (__pyx_v_strides[__pyx_v_j]) = __pyx_t_6;
19520 __Pyx_TraceLine(956,1,__PYX_ERR(1, 956, __pyx_L1_error))
19521 __pyx_t_6 = (__pyx_v_shape[__pyx_v_j]);
19522 __pyx_t_5 = (__pyx_v_shape[__pyx_v_i]);
19523 (__pyx_v_shape[__pyx_v_i]) = __pyx_t_6;
19524 (__pyx_v_shape[__pyx_v_j]) = __pyx_t_5;
19533 __Pyx_TraceLine(958,1,__PYX_ERR(1, 958, __pyx_L1_error))
19534 __pyx_t_8 = (((__pyx_v_memslice->suboffsets[__pyx_v_i]) >= 0) != 0);
19537 __pyx_t_7 = __pyx_t_8;
19538 goto __pyx_L6_bool_binop_done;
19540 __pyx_t_8 = (((__pyx_v_memslice->suboffsets[__pyx_v_j]) >= 0) != 0);
19541 __pyx_t_7 = __pyx_t_8;
19542 __pyx_L6_bool_binop_done:;
19552 __Pyx_TraceLine(959,1,__PYX_ERR(1, 959, __pyx_L1_error))
19553 __pyx_t_9 = __pyx_memoryview_err(__pyx_builtin_ValueError, ((
char *)
"Cannot transpose memoryview with indirect dimensions"));
if (unlikely(__pyx_t_9 == ((
int)-1))) __PYX_ERR(1, 959, __pyx_L1_error)
19572 __Pyx_TraceLine(961,1,__PYX_ERR(1, 961, __pyx_L1_error))
19588 PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
19590 __Pyx_AddTraceback(
"View.MemoryView.transpose_memslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
19592 __Pyx_PyGILState_Release(__pyx_gilstate_save);
19597 __Pyx_TraceReturn(Py_None, 1);
19610 static void __pyx_memoryviewslice___dealloc__(PyObject *__pyx_v_self);
19611 static void __pyx_memoryviewslice___dealloc__(PyObject *__pyx_v_self) {
19612 __Pyx_RefNannyDeclarations
19613 __Pyx_RefNannySetupContext(
"__dealloc__ (wrapper)", 0);
19614 __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(((
struct __pyx_memoryviewslice_obj *)__pyx_v_self));
19617 __Pyx_RefNannyFinishContext();
19620 static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(
struct __pyx_memoryviewslice_obj *__pyx_v_self) {
19621 __Pyx_TraceDeclarations
19622 __Pyx_RefNannyDeclarations
19623 int __pyx_lineno = 0;
19624 const char *__pyx_filename = NULL;
19625 int __pyx_clineno = 0;
19626 __Pyx_RefNannySetupContext(
"__dealloc__", 0);
19627 __Pyx_TraceCall(
"__dealloc__", __pyx_f[1], 978, 0, __PYX_ERR(1, 978, __pyx_L1_error));
19636 __Pyx_TraceLine(979,0,__PYX_ERR(1, 979, __pyx_L1_error))
19637 __PYX_XDEC_MEMVIEW((&__pyx_v_self->from_slice), 1);
19650 __Pyx_WriteUnraisable(
"View.MemoryView._memoryviewslice.__dealloc__", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
19652 __Pyx_TraceReturn(Py_None, 0);
19653 __Pyx_RefNannyFinishContext();
19664 static PyObject *__pyx_memoryviewslice_convert_item_to_object(
struct __pyx_memoryviewslice_obj *__pyx_v_self,
char *__pyx_v_itemp) {
19665 PyObject *__pyx_r = NULL;
19666 __Pyx_TraceDeclarations
19667 __Pyx_RefNannyDeclarations
19669 PyObject *__pyx_t_2 = NULL;
19670 int __pyx_lineno = 0;
19671 const char *__pyx_filename = NULL;
19672 int __pyx_clineno = 0;
19673 __Pyx_RefNannySetupContext(
"convert_item_to_object", 0);
19674 __Pyx_TraceCall(
"convert_item_to_object", __pyx_f[1], 981, 0, __PYX_ERR(1, 981, __pyx_L1_error));
19683 __Pyx_TraceLine(982,0,__PYX_ERR(1, 982, __pyx_L1_error))
19684 __pyx_t_1 = ((__pyx_v_self->to_object_func != NULL) != 0);
19694 __Pyx_TraceLine(983,0,__PYX_ERR(1, 983, __pyx_L1_error))
19695 __Pyx_XDECREF(__pyx_r);
19696 __pyx_t_2 = __pyx_v_self->to_object_func(__pyx_v_itemp);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 983, __pyx_L1_error)
19697 __Pyx_GOTREF(__pyx_t_2);
19698 __pyx_r = __pyx_t_2;
19718 __Pyx_TraceLine(985,0,__PYX_ERR(1, 985, __pyx_L1_error))
19720 __Pyx_XDECREF(__pyx_r);
19721 __pyx_t_2 = __pyx_memoryview_convert_item_to_object(((
struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_itemp);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 985, __pyx_L1_error)
19722 __Pyx_GOTREF(__pyx_t_2);
19723 __pyx_r = __pyx_t_2;
19738 __Pyx_XDECREF(__pyx_t_2);
19739 __Pyx_AddTraceback(
"View.MemoryView._memoryviewslice.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
19742 __Pyx_XGIVEREF(__pyx_r);
19743 __Pyx_TraceReturn(__pyx_r, 0);
19744 __Pyx_RefNannyFinishContext();
19756 static PyObject *__pyx_memoryviewslice_assign_item_from_object(
struct __pyx_memoryviewslice_obj *__pyx_v_self,
char *__pyx_v_itemp, PyObject *__pyx_v_value) {
19757 PyObject *__pyx_r = NULL;
19758 __Pyx_TraceDeclarations
19759 __Pyx_RefNannyDeclarations
19762 PyObject *__pyx_t_3 = NULL;
19763 int __pyx_lineno = 0;
19764 const char *__pyx_filename = NULL;
19765 int __pyx_clineno = 0;
19766 __Pyx_RefNannySetupContext(
"assign_item_from_object", 0);
19767 __Pyx_TraceCall(
"assign_item_from_object", __pyx_f[1], 987, 0, __PYX_ERR(1, 987, __pyx_L1_error));
19776 __Pyx_TraceLine(988,0,__PYX_ERR(1, 988, __pyx_L1_error))
19777 __pyx_t_1 = ((__pyx_v_self->to_dtype_func != NULL) != 0);
19787 __Pyx_TraceLine(989,0,__PYX_ERR(1, 989, __pyx_L1_error))
19788 __pyx_t_2 = __pyx_v_self->to_dtype_func(__pyx_v_itemp, __pyx_v_value);
if (unlikely(__pyx_t_2 == ((
int)0))) __PYX_ERR(1, 989, __pyx_L1_error)
19807 __Pyx_TraceLine(991,0,__PYX_ERR(1, 991, __pyx_L1_error))
19809 __pyx_t_3 = __pyx_memoryview_assign_item_from_object(((
struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_itemp, __pyx_v_value);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 991, __pyx_L1_error)
19810 __Pyx_GOTREF(__pyx_t_3);
19811 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
19824 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
19827 __Pyx_XDECREF(__pyx_t_3);
19828 __Pyx_AddTraceback(
"View.MemoryView._memoryviewslice.assign_item_from_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
19831 __Pyx_XGIVEREF(__pyx_r);
19832 __Pyx_TraceReturn(__pyx_r, 0);
19833 __Pyx_RefNannyFinishContext();
19846 static PyObject *__pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(PyObject *__pyx_v_self);
19847 static PyObject *__pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(PyObject *__pyx_v_self) {
19848 PyObject *__pyx_r = 0;
19849 __Pyx_RefNannyDeclarations
19850 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
19851 __pyx_r = __pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(((
struct __pyx_memoryviewslice_obj *)__pyx_v_self));
19854 __Pyx_RefNannyFinishContext();
19858 static PyObject *__pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(
struct __pyx_memoryviewslice_obj *__pyx_v_self) {
19859 PyObject *__pyx_r = NULL;
19860 __Pyx_TraceDeclarations
19861 __Pyx_RefNannyDeclarations
19862 int __pyx_lineno = 0;
19863 const char *__pyx_filename = NULL;
19864 int __pyx_clineno = 0;
19865 __Pyx_RefNannySetupContext(
"__get__", 0);
19866 __Pyx_TraceCall(
"__get__", __pyx_f[1], 994, 0, __PYX_ERR(1, 994, __pyx_L1_error));
19875 __Pyx_TraceLine(995,0,__PYX_ERR(1, 995, __pyx_L1_error))
19876 __Pyx_XDECREF(__pyx_r);
19877 __Pyx_INCREF(__pyx_v_self->from_object);
19878 __pyx_r = __pyx_v_self->from_object;
19891 __Pyx_AddTraceback(
"View.MemoryView._memoryviewslice.base.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
19894 __Pyx_XGIVEREF(__pyx_r);
19895 __Pyx_TraceReturn(__pyx_r, 0);
19896 __Pyx_RefNannyFinishContext();
19907 static PyObject *__pyx_pw___pyx_memoryviewslice_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
19908 static PyMethodDef __pyx_mdef___pyx_memoryviewslice_1__reduce_cython__ = {
"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_memoryviewslice_1__reduce_cython__, METH_NOARGS, 0};
19909 static PyObject *__pyx_pw___pyx_memoryviewslice_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
19910 PyObject *__pyx_r = 0;
19911 __Pyx_RefNannyDeclarations
19912 __Pyx_RefNannySetupContext(
"__reduce_cython__ (wrapper)", 0);
19913 __pyx_r = __pyx_pf___pyx_memoryviewslice___reduce_cython__(((
struct __pyx_memoryviewslice_obj *)__pyx_v_self));
19916 __Pyx_RefNannyFinishContext();
19920 static PyObject *__pyx_pf___pyx_memoryviewslice___reduce_cython__(CYTHON_UNUSED
struct __pyx_memoryviewslice_obj *__pyx_v_self) {
19921 PyObject *__pyx_r = NULL;
19922 __Pyx_TraceDeclarations
19923 __Pyx_RefNannyDeclarations
19924 PyObject *__pyx_t_1 = NULL;
19925 int __pyx_lineno = 0;
19926 const char *__pyx_filename = NULL;
19927 int __pyx_clineno = 0;
19928 __Pyx_RefNannySetupContext(
"__reduce_cython__", 0);
19929 __Pyx_TraceCall(
"__reduce_cython__", __pyx_f[1], 1, 0, __PYX_ERR(1, 1, __pyx_L1_error));
19937 __Pyx_TraceLine(2,0,__PYX_ERR(1, 2, __pyx_L1_error))
19938 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__23, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
19939 __Pyx_GOTREF(__pyx_t_1);
19940 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
19941 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
19942 __PYX_ERR(1, 2, __pyx_L1_error)
19952 __Pyx_XDECREF(__pyx_t_1);
19953 __Pyx_AddTraceback(
"View.MemoryView._memoryviewslice.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
19955 __Pyx_XGIVEREF(__pyx_r);
19956 __Pyx_TraceReturn(__pyx_r, 0);
19957 __Pyx_RefNannyFinishContext();
19969 static PyObject *__pyx_pw___pyx_memoryviewslice_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state);
19970 static PyMethodDef __pyx_mdef___pyx_memoryviewslice_3__setstate_cython__ = {
"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_memoryviewslice_3__setstate_cython__, METH_O, 0};
19971 static PyObject *__pyx_pw___pyx_memoryviewslice_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
19972 PyObject *__pyx_r = 0;
19973 __Pyx_RefNannyDeclarations
19974 __Pyx_RefNannySetupContext(
"__setstate_cython__ (wrapper)", 0);
19975 __pyx_r = __pyx_pf___pyx_memoryviewslice_2__setstate_cython__(((
struct __pyx_memoryviewslice_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
19978 __Pyx_RefNannyFinishContext();
19982 static PyObject *__pyx_pf___pyx_memoryviewslice_2__setstate_cython__(CYTHON_UNUSED
struct __pyx_memoryviewslice_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
19983 PyObject *__pyx_r = NULL;
19984 __Pyx_TraceDeclarations
19985 __Pyx_RefNannyDeclarations
19986 PyObject *__pyx_t_1 = NULL;
19987 int __pyx_lineno = 0;
19988 const char *__pyx_filename = NULL;
19989 int __pyx_clineno = 0;
19990 __Pyx_RefNannySetupContext(
"__setstate_cython__", 0);
19991 __Pyx_TraceCall(
"__setstate_cython__", __pyx_f[1], 3, 0, __PYX_ERR(1, 3, __pyx_L1_error));
19998 __Pyx_TraceLine(4,0,__PYX_ERR(1, 4, __pyx_L1_error))
19999 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__24, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
20000 __Pyx_GOTREF(__pyx_t_1);
20001 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
20002 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20003 __PYX_ERR(1, 4, __pyx_L1_error)
20014 __Pyx_XDECREF(__pyx_t_1);
20015 __Pyx_AddTraceback(
"View.MemoryView._memoryviewslice.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
20017 __Pyx_XGIVEREF(__pyx_r);
20018 __Pyx_TraceReturn(__pyx_r, 0);
20019 __Pyx_RefNannyFinishContext();
20031 static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewslice,
int __pyx_v_ndim, PyObject *(*__pyx_v_to_object_func)(
char *),
int (*__pyx_v_to_dtype_func)(
char *, PyObject *),
int __pyx_v_dtype_is_object) {
20032 struct __pyx_memoryviewslice_obj *__pyx_v_result = 0;
20033 Py_ssize_t __pyx_v_suboffset;
20034 PyObject *__pyx_v_length = NULL;
20035 PyObject *__pyx_r = NULL;
20036 __Pyx_TraceDeclarations
20037 __Pyx_RefNannyDeclarations
20039 PyObject *__pyx_t_2 = NULL;
20040 PyObject *__pyx_t_3 = NULL;
20041 __Pyx_TypeInfo *__pyx_t_4;
20042 Py_buffer __pyx_t_5;
20043 Py_ssize_t *__pyx_t_6;
20044 Py_ssize_t *__pyx_t_7;
20045 Py_ssize_t *__pyx_t_8;
20046 Py_ssize_t __pyx_t_9;
20047 int __pyx_lineno = 0;
20048 const char *__pyx_filename = NULL;
20049 int __pyx_clineno = 0;
20050 __Pyx_RefNannySetupContext(
"memoryview_fromslice", 0);
20051 __Pyx_TraceCall(
"memoryview_fromslice", __pyx_f[1], 1001, 0, __PYX_ERR(1, 1001, __pyx_L1_error));
20060 __Pyx_TraceLine(1009,0,__PYX_ERR(1, 1009, __pyx_L1_error))
20061 __pyx_t_1 = ((((PyObject *)__pyx_v_memviewslice.memview) == Py_None) != 0);
20071 __Pyx_TraceLine(1010,0,__PYX_ERR(1, 1010, __pyx_L1_error))
20072 __Pyx_XDECREF(__pyx_r);
20073 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
20092 __Pyx_TraceLine(1015,0,__PYX_ERR(1, 1015, __pyx_L1_error))
20093 __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1015, __pyx_L1_error)
20094 __Pyx_GOTREF(__pyx_t_2);
20095 __pyx_t_3 = PyTuple_New(3);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1015, __pyx_L1_error)
20096 __Pyx_GOTREF(__pyx_t_3);
20097 __Pyx_INCREF(Py_None);
20098 __Pyx_GIVEREF(Py_None);
20099 PyTuple_SET_ITEM(__pyx_t_3, 0, Py_None);
20100 __Pyx_INCREF(__pyx_int_0);
20101 __Pyx_GIVEREF(__pyx_int_0);
20102 PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_int_0);
20103 __Pyx_GIVEREF(__pyx_t_2);
20104 PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
20106 __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryviewslice_type), __pyx_t_3, NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1015, __pyx_L1_error)
20107 __Pyx_GOTREF(__pyx_t_2);
20108 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
20109 __pyx_v_result = ((
struct __pyx_memoryviewslice_obj *)__pyx_t_2);
20119 __Pyx_TraceLine(1017,0,__PYX_ERR(1, 1017, __pyx_L1_error))
20120 __pyx_v_result->from_slice = __pyx_v_memviewslice;
20129 __Pyx_TraceLine(1018,0,__PYX_ERR(1, 1018, __pyx_L1_error))
20130 __PYX_INC_MEMVIEW((&__pyx_v_memviewslice), 1);
20139 __Pyx_TraceLine(1020,0,__PYX_ERR(1, 1020, __pyx_L1_error))
20140 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_memviewslice.memview), __pyx_n_s_base);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1020, __pyx_L1_error)
20141 __Pyx_GOTREF(__pyx_t_2);
20142 __Pyx_GIVEREF(__pyx_t_2);
20143 __Pyx_GOTREF(__pyx_v_result->from_object);
20144 __Pyx_DECREF(__pyx_v_result->from_object);
20145 __pyx_v_result->from_object = __pyx_t_2;
20155 __Pyx_TraceLine(1021,0,__PYX_ERR(1, 1021, __pyx_L1_error))
20156 __pyx_t_4 = __pyx_v_memviewslice.memview->typeinfo;
20157 __pyx_v_result->__pyx_base.typeinfo = __pyx_t_4;
20166 __Pyx_TraceLine(1023,0,__PYX_ERR(1, 1023, __pyx_L1_error))
20167 __pyx_t_5 = __pyx_v_memviewslice.memview->view;
20168 __pyx_v_result->__pyx_base.view = __pyx_t_5;
20177 __Pyx_TraceLine(1024,0,__PYX_ERR(1, 1024, __pyx_L1_error))
20178 __pyx_v_result->__pyx_base.view.buf = ((
void *)__pyx_v_memviewslice.data);
20187 __Pyx_TraceLine(1025,0,__PYX_ERR(1, 1025, __pyx_L1_error))
20188 __pyx_v_result->__pyx_base.view.ndim = __pyx_v_ndim;
20197 __Pyx_TraceLine(1026,0,__PYX_ERR(1, 1026, __pyx_L1_error))
20198 ((Py_buffer *)(&__pyx_v_result->__pyx_base.view))->obj = Py_None;
20207 __Pyx_TraceLine(1027,0,__PYX_ERR(1, 1027, __pyx_L1_error))
20208 Py_INCREF(Py_None);
20217 __Pyx_TraceLine(1029,0,__PYX_ERR(1, 1029, __pyx_L1_error))
20218 __pyx_t_1 = ((((
struct __pyx_memoryview_obj *)__pyx_v_memviewslice.memview)->flags & PyBUF_WRITABLE) != 0);
20228 __Pyx_TraceLine(1030,0,__PYX_ERR(1, 1030, __pyx_L1_error))
20229 __pyx_v_result->__pyx_base.flags = PyBUF_RECORDS;
20248 __Pyx_TraceLine(1032,0,__PYX_ERR(1, 1032, __pyx_L1_error))
20250 __pyx_v_result->__pyx_base.flags = PyBUF_RECORDS_RO;
20261 __Pyx_TraceLine(1034,0,__PYX_ERR(1, 1034, __pyx_L1_error))
20262 __pyx_v_result->__pyx_base.view.shape = ((Py_ssize_t *)__pyx_v_result->from_slice.shape);
20271 __Pyx_TraceLine(1035,0,__PYX_ERR(1, 1035, __pyx_L1_error))
20272 __pyx_v_result->__pyx_base.view.strides = ((Py_ssize_t *)__pyx_v_result->from_slice.strides);
20281 __Pyx_TraceLine(1038,0,__PYX_ERR(1, 1038, __pyx_L1_error))
20282 __pyx_v_result->__pyx_base.view.suboffsets = NULL;
20291 __Pyx_TraceLine(1039,0,__PYX_ERR(1, 1039, __pyx_L1_error))
20292 __pyx_t_7 = (__pyx_v_result->from_slice.suboffsets + __pyx_v_ndim);
20293 for (__pyx_t_8 = __pyx_v_result->from_slice.suboffsets; __pyx_t_8 < __pyx_t_7; __pyx_t_8++) {
20294 __pyx_t_6 = __pyx_t_8;
20295 __pyx_v_suboffset = (__pyx_t_6[0]);
20304 __Pyx_TraceLine(1040,0,__PYX_ERR(1, 1040, __pyx_L1_error))
20305 __pyx_t_1 = ((__pyx_v_suboffset >= 0) != 0);
20315 __Pyx_TraceLine(1041,0,__PYX_ERR(1, 1041, __pyx_L1_error))
20316 __pyx_v_result->__pyx_base.view.suboffsets = ((Py_ssize_t *)__pyx_v_result->from_slice.suboffsets);
20325 __Pyx_TraceLine(1042,0,__PYX_ERR(1, 1042, __pyx_L1_error))
20326 goto __pyx_L6_break;
20346 __Pyx_TraceLine(1044,0,__PYX_ERR(1, 1044, __pyx_L1_error))
20347 __pyx_t_9 = __pyx_v_result->__pyx_base.view.itemsize;
20348 __pyx_v_result->__pyx_base.view.len = __pyx_t_9;
20357 __Pyx_TraceLine(1045,0,__PYX_ERR(1, 1045, __pyx_L1_error))
20358 __pyx_t_7 = (__pyx_v_result->__pyx_base.view.shape + __pyx_v_ndim);
20359 for (__pyx_t_8 = __pyx_v_result->__pyx_base.view.shape; __pyx_t_8 < __pyx_t_7; __pyx_t_8++) {
20360 __pyx_t_6 = __pyx_t_8;
20361 __pyx_t_2 = PyInt_FromSsize_t((__pyx_t_6[0]));
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1045, __pyx_L1_error)
20362 __Pyx_GOTREF(__pyx_t_2);
20363 __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_2);
20373 __Pyx_TraceLine(1046,0,__PYX_ERR(1, 1046, __pyx_L1_error))
20374 __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_result->__pyx_base.view.len);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1046, __pyx_L1_error)
20375 __Pyx_GOTREF(__pyx_t_2);
20376 __pyx_t_3 = PyNumber_InPlaceMultiply(__pyx_t_2, __pyx_v_length);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1046, __pyx_L1_error)
20377 __Pyx_GOTREF(__pyx_t_3);
20378 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20379 __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3);
if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 1046, __pyx_L1_error)
20380 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
20381 __pyx_v_result->__pyx_base.view.len = __pyx_t_9;
20391 __Pyx_TraceLine(1048,0,__PYX_ERR(1, 1048, __pyx_L1_error))
20392 __pyx_v_result->to_object_func = __pyx_v_to_object_func;
20401 __Pyx_TraceLine(1049,0,__PYX_ERR(1, 1049, __pyx_L1_error))
20402 __pyx_v_result->to_dtype_func = __pyx_v_to_dtype_func;
20411 __Pyx_TraceLine(1051,0,__PYX_ERR(1, 1051, __pyx_L1_error))
20412 __Pyx_XDECREF(__pyx_r);
20413 __Pyx_INCREF(((PyObject *)__pyx_v_result));
20414 __pyx_r = ((PyObject *)__pyx_v_result);
20427 __Pyx_XDECREF(__pyx_t_2);
20428 __Pyx_XDECREF(__pyx_t_3);
20429 __Pyx_AddTraceback(
"View.MemoryView.memoryview_fromslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
20432 __Pyx_XDECREF((PyObject *)__pyx_v_result);
20433 __Pyx_XDECREF(__pyx_v_length);
20434 __Pyx_XGIVEREF(__pyx_r);
20435 __Pyx_TraceReturn(__pyx_r, 0);
20436 __Pyx_RefNannyFinishContext();
20448 static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(
struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_mslice) {
20449 struct __pyx_memoryviewslice_obj *__pyx_v_obj = 0;
20450 __Pyx_memviewslice *__pyx_r;
20451 __Pyx_TraceDeclarations
20452 __Pyx_RefNannyDeclarations
20455 PyObject *__pyx_t_3 = NULL;
20456 int __pyx_lineno = 0;
20457 const char *__pyx_filename = NULL;
20458 int __pyx_clineno = 0;
20459 __Pyx_RefNannySetupContext(
"get_slice_from_memview", 0);
20460 __Pyx_TraceCall(
"get_slice_from_memview", __pyx_f[1], 1054, 0, __PYX_ERR(1, 1054, __pyx_L1_error));
20469 __Pyx_TraceLine(1057,0,__PYX_ERR(1, 1057, __pyx_L1_error))
20470 __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
20471 __pyx_t_2 = (__pyx_t_1 != 0);
20481 __Pyx_TraceLine(1058,0,__PYX_ERR(1, 1058, __pyx_L1_error))
20482 if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(1, 1058, __pyx_L1_error)
20483 __pyx_t_3 = ((PyObject *)__pyx_v_memview);
20484 __Pyx_INCREF(__pyx_t_3);
20485 __pyx_v_obj = ((
struct __pyx_memoryviewslice_obj *)__pyx_t_3);
20495 __Pyx_TraceLine(1059,0,__PYX_ERR(1, 1059, __pyx_L1_error))
20496 __pyx_r = (&__pyx_v_obj->from_slice);
20515 __Pyx_TraceLine(1061,0,__PYX_ERR(1, 1061, __pyx_L1_error))
20517 __pyx_memoryview_slice_copy(__pyx_v_memview, __pyx_v_mslice);
20526 __Pyx_TraceLine(1062,0,__PYX_ERR(1, 1062, __pyx_L1_error))
20527 __pyx_r = __pyx_v_mslice;
20541 __Pyx_XDECREF(__pyx_t_3);
20542 __Pyx_AddTraceback(
"View.MemoryView.get_slice_from_memview", __pyx_clineno, __pyx_lineno, __pyx_filename);
20545 __Pyx_XDECREF((PyObject *)__pyx_v_obj);
20546 __Pyx_TraceReturn(Py_None, 0);
20547 __Pyx_RefNannyFinishContext();
20559 static void __pyx_memoryview_slice_copy(
struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_dst) {
20561 Py_ssize_t *__pyx_v_shape;
20562 Py_ssize_t *__pyx_v_strides;
20563 Py_ssize_t *__pyx_v_suboffsets;
20564 __Pyx_TraceDeclarations
20565 __Pyx_RefNannyDeclarations
20566 Py_ssize_t *__pyx_t_1;
20570 Py_ssize_t __pyx_t_5;
20571 int __pyx_lineno = 0;
20572 const char *__pyx_filename = NULL;
20573 int __pyx_clineno = 0;
20574 __Pyx_RefNannySetupContext(
"slice_copy", 0);
20575 __Pyx_TraceCall(
"slice_copy", __pyx_f[1], 1065, 0, __PYX_ERR(1, 1065, __pyx_L1_error));
20584 __Pyx_TraceLine(1069,0,__PYX_ERR(1, 1069, __pyx_L1_error))
20585 __pyx_t_1 = __pyx_v_memview->view.shape;
20586 __pyx_v_shape = __pyx_t_1;
20595 __Pyx_TraceLine(1070,0,__PYX_ERR(1, 1070, __pyx_L1_error))
20596 __pyx_t_1 = __pyx_v_memview->view.strides;
20597 __pyx_v_strides = __pyx_t_1;
20606 __Pyx_TraceLine(1071,0,__PYX_ERR(1, 1071, __pyx_L1_error))
20607 __pyx_t_1 = __pyx_v_memview->view.suboffsets;
20608 __pyx_v_suboffsets = __pyx_t_1;
20617 __Pyx_TraceLine(1073,0,__PYX_ERR(1, 1073, __pyx_L1_error))
20618 __pyx_v_dst->memview = ((
struct __pyx_memoryview_obj *)__pyx_v_memview);
20627 __Pyx_TraceLine(1074,0,__PYX_ERR(1, 1074, __pyx_L1_error))
20628 __pyx_v_dst->data = ((
char *)__pyx_v_memview->view.buf);
20637 __Pyx_TraceLine(1076,0,__PYX_ERR(1, 1076, __pyx_L1_error))
20638 __pyx_t_2 = __pyx_v_memview->view.ndim;
20639 __pyx_t_3 = __pyx_t_2;
20640 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
20641 __pyx_v_dim = __pyx_t_4;
20650 __Pyx_TraceLine(1077,0,__PYX_ERR(1, 1077, __pyx_L1_error))
20651 (__pyx_v_dst->shape[__pyx_v_dim]) = (__pyx_v_shape[__pyx_v_dim]);
20660 __Pyx_TraceLine(1078,0,__PYX_ERR(1, 1078, __pyx_L1_error))
20661 (__pyx_v_dst->strides[__pyx_v_dim]) = (__pyx_v_strides[__pyx_v_dim]);
20670 __Pyx_TraceLine(1079,0,__PYX_ERR(1, 1079, __pyx_L1_error))
20671 if ((__pyx_v_suboffsets != 0)) {
20672 __pyx_t_5 = (__pyx_v_suboffsets[__pyx_v_dim]);
20676 (__pyx_v_dst->suboffsets[__pyx_v_dim]) = __pyx_t_5;
20690 __Pyx_WriteUnraisable(
"View.MemoryView.slice_copy", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
20692 __Pyx_TraceReturn(Py_None, 0);
20693 __Pyx_RefNannyFinishContext();
20704 static PyObject *__pyx_memoryview_copy_object(
struct __pyx_memoryview_obj *__pyx_v_memview) {
20705 __Pyx_memviewslice __pyx_v_memviewslice;
20706 PyObject *__pyx_r = NULL;
20707 __Pyx_TraceDeclarations
20708 __Pyx_RefNannyDeclarations
20709 PyObject *__pyx_t_1 = NULL;
20710 int __pyx_lineno = 0;
20711 const char *__pyx_filename = NULL;
20712 int __pyx_clineno = 0;
20713 __Pyx_RefNannySetupContext(
"memoryview_copy", 0);
20714 __Pyx_TraceCall(
"memoryview_copy", __pyx_f[1], 1082, 0, __PYX_ERR(1, 1082, __pyx_L1_error));
20723 __Pyx_TraceLine(1085,0,__PYX_ERR(1, 1085, __pyx_L1_error))
20724 __pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_memviewslice));
20733 __Pyx_TraceLine(1086,0,__PYX_ERR(1, 1086, __pyx_L1_error))
20734 __Pyx_XDECREF(__pyx_r);
20735 __pyx_t_1 = __pyx_memoryview_copy_object_from_slice(__pyx_v_memview, (&__pyx_v_memviewslice));
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1086, __pyx_L1_error)
20736 __Pyx_GOTREF(__pyx_t_1);
20737 __pyx_r = __pyx_t_1;
20751 __Pyx_XDECREF(__pyx_t_1);
20752 __Pyx_AddTraceback(
"View.MemoryView.memoryview_copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
20755 __Pyx_XGIVEREF(__pyx_r);
20756 __Pyx_TraceReturn(__pyx_r, 0);
20757 __Pyx_RefNannyFinishContext();
20769 static PyObject *__pyx_memoryview_copy_object_from_slice(
struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_memviewslice) {
20770 PyObject *(*__pyx_v_to_object_func)(
char *);
20771 int (*__pyx_v_to_dtype_func)(
char *, PyObject *);
20772 PyObject *__pyx_r = NULL;
20773 __Pyx_TraceDeclarations
20774 __Pyx_RefNannyDeclarations
20777 PyObject *(*__pyx_t_3)(
char *);
20778 int (*__pyx_t_4)(
char *, PyObject *);
20779 PyObject *__pyx_t_5 = NULL;
20780 int __pyx_lineno = 0;
20781 const char *__pyx_filename = NULL;
20782 int __pyx_clineno = 0;
20783 __Pyx_RefNannySetupContext(
"memoryview_copy_from_slice", 0);
20784 __Pyx_TraceCall(
"memoryview_copy_from_slice", __pyx_f[1], 1089, 0, __PYX_ERR(1, 1089, __pyx_L1_error));
20793 __Pyx_TraceLine(1096,0,__PYX_ERR(1, 1096, __pyx_L1_error))
20794 __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
20795 __pyx_t_2 = (__pyx_t_1 != 0);
20805 __Pyx_TraceLine(1097,0,__PYX_ERR(1, 1097, __pyx_L1_error))
20806 __pyx_t_3 = ((
struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_object_func;
20807 __pyx_v_to_object_func = __pyx_t_3;
20816 __Pyx_TraceLine(1098,0,__PYX_ERR(1, 1098, __pyx_L1_error))
20817 __pyx_t_4 = ((
struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_dtype_func;
20818 __pyx_v_to_dtype_func = __pyx_t_4;
20837 __Pyx_TraceLine(1100,0,__PYX_ERR(1, 1100, __pyx_L1_error))
20839 __pyx_v_to_object_func = NULL;
20848 __Pyx_TraceLine(1101,0,__PYX_ERR(1, 1101, __pyx_L1_error))
20849 __pyx_v_to_dtype_func = NULL;
20860 __Pyx_TraceLine(1103,0,__PYX_ERR(1, 1103, __pyx_L1_error))
20861 __Pyx_XDECREF(__pyx_r);
20870 __Pyx_TraceLine(1105,0,__PYX_ERR(1, 1105, __pyx_L1_error))
20871 __pyx_t_5 = __pyx_memoryview_fromslice((__pyx_v_memviewslice[0]), __pyx_v_memview->view.ndim, __pyx_v_to_object_func, __pyx_v_to_dtype_func, __pyx_v_memview->dtype_is_object);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1103, __pyx_L1_error)
20872 __Pyx_GOTREF(__pyx_t_5);
20873 __pyx_r = __pyx_t_5;
20887 __Pyx_XDECREF(__pyx_t_5);
20888 __Pyx_AddTraceback(
"View.MemoryView.memoryview_copy_from_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
20891 __Pyx_XGIVEREF(__pyx_r);
20892 __Pyx_TraceReturn(__pyx_r, 0);
20893 __Pyx_RefNannyFinishContext();
20905 static Py_ssize_t abs_py_ssize_t(Py_ssize_t __pyx_v_arg) {
20906 Py_ssize_t __pyx_r;
20907 __Pyx_TraceDeclarations
20909 int __pyx_lineno = 0;
20910 const char *__pyx_filename = NULL;
20911 int __pyx_clineno = 0;
20912 __Pyx_TraceCall(
"abs_py_ssize_t", __pyx_f[1], 1111, 1, __PYX_ERR(1, 1111, __pyx_L1_error));
20921 __Pyx_TraceLine(1112,1,__PYX_ERR(1, 1112, __pyx_L1_error))
20922 __pyx_t_1 = ((__pyx_v_arg < 0) != 0);
20932 __Pyx_TraceLine(1113,1,__PYX_ERR(1, 1113, __pyx_L1_error))
20933 __pyx_r = (-__pyx_v_arg);
20952 __Pyx_TraceLine(1115,1,__PYX_ERR(1, 1115, __pyx_L1_error))
20954 __pyx_r = __pyx_v_arg;
20968 __Pyx_WriteUnraisable(
"View.MemoryView.abs_py_ssize_t", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
20971 __Pyx_TraceReturn(Py_None, 1);
20983 static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice,
int __pyx_v_ndim) {
20985 Py_ssize_t __pyx_v_c_stride;
20986 Py_ssize_t __pyx_v_f_stride;
20988 __Pyx_TraceDeclarations
20993 int __pyx_lineno = 0;
20994 const char *__pyx_filename = NULL;
20995 int __pyx_clineno = 0;
20996 __Pyx_TraceCall(
"get_best_order", __pyx_f[1], 1118, 1, __PYX_ERR(1, 1118, __pyx_L1_error));
21005 __Pyx_TraceLine(1123,1,__PYX_ERR(1, 1123, __pyx_L1_error))
21006 __pyx_v_c_stride = 0;
21015 __Pyx_TraceLine(1124,1,__PYX_ERR(1, 1124, __pyx_L1_error))
21016 __pyx_v_f_stride = 0;
21025 __Pyx_TraceLine(1126,1,__PYX_ERR(1, 1126, __pyx_L1_error))
21026 for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1; __pyx_t_1-=1) {
21027 __pyx_v_i = __pyx_t_1;
21036 __Pyx_TraceLine(1127,1,__PYX_ERR(1, 1127, __pyx_L1_error))
21037 __pyx_t_2 = (((__pyx_v_mslice->shape[__pyx_v_i]) > 1) != 0);
21047 __Pyx_TraceLine(1128,1,__PYX_ERR(1, 1128, __pyx_L1_error))
21048 __pyx_v_c_stride = (__pyx_v_mslice->strides[__pyx_v_i]);
21057 __Pyx_TraceLine(1129,1,__PYX_ERR(1, 1129, __pyx_L1_error))
21058 goto __pyx_L4_break;
21078 __Pyx_TraceLine(1131,1,__PYX_ERR(1, 1131, __pyx_L1_error))
21079 __pyx_t_1 = __pyx_v_ndim;
21080 __pyx_t_3 = __pyx_t_1;
21081 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
21082 __pyx_v_i = __pyx_t_4;
21091 __Pyx_TraceLine(1132,1,__PYX_ERR(1, 1132, __pyx_L1_error))
21092 __pyx_t_2 = (((__pyx_v_mslice->shape[__pyx_v_i]) > 1) != 0);
21102 __Pyx_TraceLine(1133,1,__PYX_ERR(1, 1133, __pyx_L1_error))
21103 __pyx_v_f_stride = (__pyx_v_mslice->strides[__pyx_v_i]);
21112 __Pyx_TraceLine(1134,1,__PYX_ERR(1, 1134, __pyx_L1_error))
21113 goto __pyx_L7_break;
21133 __Pyx_TraceLine(1136,1,__PYX_ERR(1, 1136, __pyx_L1_error))
21134 __pyx_t_2 = ((abs_py_ssize_t(__pyx_v_c_stride) <= abs_py_ssize_t(__pyx_v_f_stride)) != 0);
21144 __Pyx_TraceLine(1137,1,__PYX_ERR(1, 1137, __pyx_L1_error))
21164 __Pyx_TraceLine(1139,1,__PYX_ERR(1, 1139, __pyx_L1_error))
21180 __Pyx_WriteUnraisable(
"View.MemoryView.get_best_order", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
21183 __Pyx_TraceReturn(Py_None, 1);
21195 static void _copy_strided_to_strided(
char *__pyx_v_src_data, Py_ssize_t *__pyx_v_src_strides,
char *__pyx_v_dst_data, Py_ssize_t *__pyx_v_dst_strides, Py_ssize_t *__pyx_v_src_shape, Py_ssize_t *__pyx_v_dst_shape,
int __pyx_v_ndim,
size_t __pyx_v_itemsize) {
21196 CYTHON_UNUSED Py_ssize_t __pyx_v_i;
21197 CYTHON_UNUSED Py_ssize_t __pyx_v_src_extent;
21198 Py_ssize_t __pyx_v_dst_extent;
21199 Py_ssize_t __pyx_v_src_stride;
21200 Py_ssize_t __pyx_v_dst_stride;
21204 Py_ssize_t __pyx_t_4;
21205 Py_ssize_t __pyx_t_5;
21206 Py_ssize_t __pyx_t_6;
21215 __pyx_v_src_extent = (__pyx_v_src_shape[0]);
21224 __pyx_v_dst_extent = (__pyx_v_dst_shape[0]);
21233 __pyx_v_src_stride = (__pyx_v_src_strides[0]);
21242 __pyx_v_dst_stride = (__pyx_v_dst_strides[0]);
21251 __pyx_t_1 = ((__pyx_v_ndim == 1) != 0);
21261 __pyx_t_2 = ((__pyx_v_src_stride > 0) != 0);
21264 __pyx_t_1 = __pyx_t_2;
21265 goto __pyx_L5_bool_binop_done;
21267 __pyx_t_2 = ((__pyx_v_dst_stride > 0) != 0);
21270 __pyx_t_1 = __pyx_t_2;
21271 goto __pyx_L5_bool_binop_done;
21281 __pyx_t_2 = (((size_t)__pyx_v_src_stride) == __pyx_v_itemsize);
21283 __pyx_t_2 = (__pyx_v_itemsize == ((size_t)__pyx_v_dst_stride));
21285 __pyx_t_3 = (__pyx_t_2 != 0);
21286 __pyx_t_1 = __pyx_t_3;
21287 __pyx_L5_bool_binop_done:;
21305 (void)(memcpy(__pyx_v_dst_data, __pyx_v_src_data, (__pyx_v_itemsize * __pyx_v_dst_extent)));
21325 __pyx_t_4 = __pyx_v_dst_extent;
21326 __pyx_t_5 = __pyx_t_4;
21327 for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
21328 __pyx_v_i = __pyx_t_6;
21337 (void)(memcpy(__pyx_v_dst_data, __pyx_v_src_data, __pyx_v_itemsize));
21346 __pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride);
21355 __pyx_v_dst_data = (__pyx_v_dst_data + __pyx_v_dst_stride);
21378 __pyx_t_4 = __pyx_v_dst_extent;
21379 __pyx_t_5 = __pyx_t_4;
21380 for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
21381 __pyx_v_i = __pyx_t_6;
21390 _copy_strided_to_strided(__pyx_v_src_data, (__pyx_v_src_strides + 1), __pyx_v_dst_data, (__pyx_v_dst_strides + 1), (__pyx_v_src_shape + 1), (__pyx_v_dst_shape + 1), (__pyx_v_ndim - 1), __pyx_v_itemsize);
21399 __pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride);
21408 __pyx_v_dst_data = (__pyx_v_dst_data + __pyx_v_dst_stride);
21432 static void copy_strided_to_strided(__Pyx_memviewslice *__pyx_v_src, __Pyx_memviewslice *__pyx_v_dst,
int __pyx_v_ndim,
size_t __pyx_v_itemsize) {
21433 __Pyx_TraceDeclarations
21434 int __pyx_lineno = 0;
21435 const char *__pyx_filename = NULL;
21436 int __pyx_clineno = 0;
21437 __Pyx_TraceCall(
"copy_strided_to_strided", __pyx_f[1], 1172, 1, __PYX_ERR(1, 1172, __pyx_L1_error));
21446 __Pyx_TraceLine(1175,1,__PYX_ERR(1, 1175, __pyx_L1_error))
21447 _copy_strided_to_strided(__pyx_v_src->data, __pyx_v_src->strides, __pyx_v_dst->data, __pyx_v_dst->strides, __pyx_v_src->shape, __pyx_v_dst->shape, __pyx_v_ndim, __pyx_v_itemsize);
21460 __Pyx_WriteUnraisable(
"View.MemoryView.copy_strided_to_strided", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
21462 __Pyx_TraceReturn(Py_None, 1);
21473 static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *__pyx_v_src,
int __pyx_v_ndim) {
21474 Py_ssize_t __pyx_v_shape;
21475 Py_ssize_t __pyx_v_size;
21476 Py_ssize_t __pyx_r;
21477 __Pyx_TraceDeclarations
21478 Py_ssize_t __pyx_t_1;
21479 Py_ssize_t *__pyx_t_2;
21480 Py_ssize_t *__pyx_t_3;
21481 Py_ssize_t *__pyx_t_4;
21482 int __pyx_lineno = 0;
21483 const char *__pyx_filename = NULL;
21484 int __pyx_clineno = 0;
21485 __Pyx_TraceCall(
"slice_get_size", __pyx_f[1], 1179, 1, __PYX_ERR(1, 1179, __pyx_L1_error));
21494 __Pyx_TraceLine(1181,1,__PYX_ERR(1, 1181, __pyx_L1_error))
21495 __pyx_t_1 = __pyx_v_src->memview->view.itemsize;
21496 __pyx_v_size = __pyx_t_1;
21505 __Pyx_TraceLine(1183,1,__PYX_ERR(1, 1183, __pyx_L1_error))
21506 __pyx_t_3 = (__pyx_v_src->shape + __pyx_v_ndim);
21507 for (__pyx_t_4 = __pyx_v_src->shape; __pyx_t_4 < __pyx_t_3; __pyx_t_4++) {
21508 __pyx_t_2 = __pyx_t_4;
21509 __pyx_v_shape = (__pyx_t_2[0]);
21518 __Pyx_TraceLine(1184,1,__PYX_ERR(1, 1184, __pyx_L1_error))
21519 __pyx_v_size = (__pyx_v_size * __pyx_v_shape);
21529 __Pyx_TraceLine(1186,1,__PYX_ERR(1, 1186, __pyx_L1_error))
21530 __pyx_r = __pyx_v_size;
21543 __Pyx_WriteUnraisable(
"View.MemoryView.slice_get_size", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
21546 __Pyx_TraceReturn(Py_None, 1);
21558 static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, Py_ssize_t __pyx_v_stride,
int __pyx_v_ndim,
char __pyx_v_order) {
21560 Py_ssize_t __pyx_r;
21561 __Pyx_TraceDeclarations
21566 int __pyx_lineno = 0;
21567 const char *__pyx_filename = NULL;
21568 int __pyx_clineno = 0;
21569 __Pyx_TraceCall(
"fill_contig_strides_array", __pyx_f[1], 1189, 1, __PYX_ERR(1, 1189, __pyx_L1_error));
21578 __Pyx_TraceLine(1198,1,__PYX_ERR(1, 1198, __pyx_L1_error))
21579 __pyx_t_1 = ((__pyx_v_order ==
'F') != 0);
21589 __Pyx_TraceLine(1199,1,__PYX_ERR(1, 1199, __pyx_L1_error))
21590 __pyx_t_2 = __pyx_v_ndim;
21591 __pyx_t_3 = __pyx_t_2;
21592 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
21593 __pyx_v_idx = __pyx_t_4;
21602 __Pyx_TraceLine(1200,1,__PYX_ERR(1, 1200, __pyx_L1_error))
21603 (__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride;
21612 __Pyx_TraceLine(1201,1,__PYX_ERR(1, 1201, __pyx_L1_error))
21613 __pyx_v_stride = (__pyx_v_stride * (__pyx_v_shape[__pyx_v_idx]));
21633 __Pyx_TraceLine(1203,1,__PYX_ERR(1, 1203, __pyx_L1_error))
21635 for (__pyx_t_2 = (__pyx_v_ndim - 1); __pyx_t_2 > -1; __pyx_t_2-=1) {
21636 __pyx_v_idx = __pyx_t_2;
21645 __Pyx_TraceLine(1204,1,__PYX_ERR(1, 1204, __pyx_L1_error))
21646 (__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride;
21655 __Pyx_TraceLine(1205,1,__PYX_ERR(1, 1205, __pyx_L1_error))
21656 __pyx_v_stride = (__pyx_v_stride * (__pyx_v_shape[__pyx_v_idx]));
21668 __Pyx_TraceLine(1207,1,__PYX_ERR(1, 1207, __pyx_L1_error))
21669 __pyx_r = __pyx_v_stride;
21682 __Pyx_WriteUnraisable(
"View.MemoryView.fill_contig_strides_array", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
21685 __Pyx_TraceReturn(Py_None, 1);
21697 static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src, __Pyx_memviewslice *__pyx_v_tmpslice,
char __pyx_v_order,
int __pyx_v_ndim) {
21699 void *__pyx_v_result;
21700 size_t __pyx_v_itemsize;
21701 size_t __pyx_v_size;
21703 __Pyx_TraceDeclarations
21704 Py_ssize_t __pyx_t_1;
21707 struct __pyx_memoryview_obj *__pyx_t_4;
21710 int __pyx_lineno = 0;
21711 const char *__pyx_filename = NULL;
21712 int __pyx_clineno = 0;
21713 __Pyx_TraceCall(
"copy_data_to_temp", __pyx_f[1], 1210, 1, __PYX_ERR(1, 1210, __pyx_L1_error));
21722 __Pyx_TraceLine(1221,1,__PYX_ERR(1, 1221, __pyx_L1_error))
21723 __pyx_t_1 = __pyx_v_src->memview->view.itemsize;
21724 __pyx_v_itemsize = __pyx_t_1;
21733 __Pyx_TraceLine(1222,1,__PYX_ERR(1, 1222, __pyx_L1_error))
21734 __pyx_v_size = __pyx_memoryview_slice_get_size(__pyx_v_src, __pyx_v_ndim);
21743 __Pyx_TraceLine(1224,1,__PYX_ERR(1, 1224, __pyx_L1_error))
21744 __pyx_v_result = malloc(__pyx_v_size);
21753 __Pyx_TraceLine(1225,1,__PYX_ERR(1, 1225, __pyx_L1_error))
21754 __pyx_t_2 = ((!(__pyx_v_result != 0)) != 0);
21764 __Pyx_TraceLine(1226,1,__PYX_ERR(1, 1226, __pyx_L1_error))
21765 __pyx_t_3 = __pyx_memoryview_err(__pyx_builtin_MemoryError, NULL);
if (unlikely(__pyx_t_3 == ((
int)-1))) __PYX_ERR(1, 1226, __pyx_L1_error)
21783 __Pyx_TraceLine(1229,1,__PYX_ERR(1, 1229, __pyx_L1_error))
21784 __pyx_v_tmpslice->data = ((
char *)__pyx_v_result);
21793 __Pyx_TraceLine(1230,1,__PYX_ERR(1, 1230, __pyx_L1_error))
21794 __pyx_t_4 = __pyx_v_src->memview;
21795 __pyx_v_tmpslice->memview = __pyx_t_4;
21804 __Pyx_TraceLine(1231,1,__PYX_ERR(1, 1231, __pyx_L1_error))
21805 __pyx_t_3 = __pyx_v_ndim;
21806 __pyx_t_5 = __pyx_t_3;
21807 for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
21808 __pyx_v_i = __pyx_t_6;
21817 __Pyx_TraceLine(1232,1,__PYX_ERR(1, 1232, __pyx_L1_error))
21818 (__pyx_v_tmpslice->shape[__pyx_v_i]) = (__pyx_v_src->shape[__pyx_v_i]);
21827 __Pyx_TraceLine(1233,1,__PYX_ERR(1, 1233, __pyx_L1_error))
21828 (__pyx_v_tmpslice->suboffsets[__pyx_v_i]) = -1L;
21838 __Pyx_TraceLine(1235,1,__PYX_ERR(1, 1235, __pyx_L1_error))
21839 (void)(__pyx_fill_contig_strides_array((&(__pyx_v_tmpslice->shape[0])), (&(__pyx_v_tmpslice->strides[0])), __pyx_v_itemsize, __pyx_v_ndim, __pyx_v_order));
21848 __Pyx_TraceLine(1239,1,__PYX_ERR(1, 1239, __pyx_L1_error))
21849 __pyx_t_3 = __pyx_v_ndim;
21850 __pyx_t_5 = __pyx_t_3;
21851 for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
21852 __pyx_v_i = __pyx_t_6;
21861 __Pyx_TraceLine(1240,1,__PYX_ERR(1, 1240, __pyx_L1_error))
21862 __pyx_t_2 = (((__pyx_v_tmpslice->shape[__pyx_v_i]) == 1) != 0);
21872 __Pyx_TraceLine(1241,1,__PYX_ERR(1, 1241, __pyx_L1_error))
21873 (__pyx_v_tmpslice->strides[__pyx_v_i]) = 0;
21892 __Pyx_TraceLine(1243,1,__PYX_ERR(1, 1243, __pyx_L1_error))
21893 __pyx_t_2 = (__pyx_memviewslice_is_contig((__pyx_v_src[0]), __pyx_v_order, __pyx_v_ndim) != 0);
21903 __Pyx_TraceLine(1244,1,__PYX_ERR(1, 1244, __pyx_L1_error))
21904 (void)(memcpy(__pyx_v_result, __pyx_v_src->data, __pyx_v_size));
21923 __Pyx_TraceLine(1246,1,__PYX_ERR(1, 1246, __pyx_L1_error))
21925 copy_strided_to_strided(__pyx_v_src, __pyx_v_tmpslice, __pyx_v_ndim, __pyx_v_itemsize);
21936 __Pyx_TraceLine(1248,1,__PYX_ERR(1, 1248, __pyx_L1_error))
21937 __pyx_r = __pyx_v_result;
21952 PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
21954 __Pyx_AddTraceback(
"View.MemoryView.copy_data_to_temp", __pyx_clineno, __pyx_lineno, __pyx_filename);
21956 __Pyx_PyGILState_Release(__pyx_gilstate_save);
21961 __Pyx_TraceReturn(Py_None, 1);
21973 static int __pyx_memoryview_err_extents(
int __pyx_v_i, Py_ssize_t __pyx_v_extent1, Py_ssize_t __pyx_v_extent2) {
21975 __Pyx_TraceDeclarations
21976 __Pyx_RefNannyDeclarations
21977 PyObject *__pyx_t_1 = NULL;
21978 PyObject *__pyx_t_2 = NULL;
21979 PyObject *__pyx_t_3 = NULL;
21980 PyObject *__pyx_t_4 = NULL;
21981 int __pyx_lineno = 0;
21982 const char *__pyx_filename = NULL;
21983 int __pyx_clineno = 0;
21985 PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
21987 __Pyx_RefNannySetupContext(
"_err_extents", 0);
21988 __Pyx_TraceCall(
"_err_extents", __pyx_f[1], 1253, 0, __PYX_ERR(1, 1253, __pyx_L1_error));
21997 __Pyx_TraceLine(1256,0,__PYX_ERR(1, 1256, __pyx_L1_error))
21998 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_i);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1256, __pyx_L1_error)
21999 __Pyx_GOTREF(__pyx_t_1);
22000 __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_extent1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1256, __pyx_L1_error)
22001 __Pyx_GOTREF(__pyx_t_2);
22002 __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_extent2);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1256, __pyx_L1_error)
22003 __Pyx_GOTREF(__pyx_t_3);
22004 __pyx_t_4 = PyTuple_New(3);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1256, __pyx_L1_error)
22005 __Pyx_GOTREF(__pyx_t_4);
22006 __Pyx_GIVEREF(__pyx_t_1);
22007 PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
22008 __Pyx_GIVEREF(__pyx_t_2);
22009 PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2);
22010 __Pyx_GIVEREF(__pyx_t_3);
22011 PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3);
22023 __Pyx_TraceLine(1255,0,__PYX_ERR(1, 1255, __pyx_L1_error))
22024 __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_got_differing_extents_in_dimensi, __pyx_t_4);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1255, __pyx_L1_error)
22025 __Pyx_GOTREF(__pyx_t_3);
22026 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
22027 __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1255, __pyx_L1_error)
22028 __Pyx_GOTREF(__pyx_t_4);
22029 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
22030 __Pyx_Raise(__pyx_t_4, 0, 0, 0);
22031 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
22032 __PYX_ERR(1, 1255, __pyx_L1_error)
22044 __Pyx_XDECREF(__pyx_t_1);
22045 __Pyx_XDECREF(__pyx_t_2);
22046 __Pyx_XDECREF(__pyx_t_3);
22047 __Pyx_XDECREF(__pyx_t_4);
22048 __Pyx_AddTraceback(
"View.MemoryView._err_extents", __pyx_clineno, __pyx_lineno, __pyx_filename);
22050 __Pyx_TraceReturn(Py_None, 0);
22051 __Pyx_RefNannyFinishContext();
22053 __Pyx_PyGILState_Release(__pyx_gilstate_save);
22066 static int __pyx_memoryview_err_dim(PyObject *__pyx_v_error,
char *__pyx_v_msg,
int __pyx_v_dim) {
22068 __Pyx_TraceDeclarations
22069 __Pyx_RefNannyDeclarations
22070 PyObject *__pyx_t_1 = NULL;
22071 PyObject *__pyx_t_2 = NULL;
22072 PyObject *__pyx_t_3 = NULL;
22073 PyObject *__pyx_t_4 = NULL;
22074 int __pyx_lineno = 0;
22075 const char *__pyx_filename = NULL;
22076 int __pyx_clineno = 0;
22078 PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
22080 __Pyx_RefNannySetupContext(
"_err_dim", 0);
22081 __Pyx_TraceCall(
"_err_dim", __pyx_f[1], 1259, 0, __PYX_ERR(1, 1259, __pyx_L1_error));
22082 __Pyx_INCREF(__pyx_v_error);
22091 __Pyx_TraceLine(1260,0,__PYX_ERR(1, 1260, __pyx_L1_error))
22092 __pyx_t_2 = __Pyx_decode_c_string(__pyx_v_msg, 0, strlen(__pyx_v_msg), NULL, NULL, PyUnicode_DecodeASCII);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1260, __pyx_L1_error)
22093 __Pyx_GOTREF(__pyx_t_2);
22094 __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_dim);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1260, __pyx_L1_error)
22095 __Pyx_GOTREF(__pyx_t_3);
22096 __pyx_t_4 = PyUnicode_Format(__pyx_t_2, __pyx_t_3);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1260, __pyx_L1_error)
22097 __Pyx_GOTREF(__pyx_t_4);
22098 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
22099 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
22100 __Pyx_INCREF(__pyx_v_error);
22101 __pyx_t_3 = __pyx_v_error; __pyx_t_2 = NULL;
22102 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
22103 __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
22104 if (likely(__pyx_t_2)) {
22105 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
22106 __Pyx_INCREF(__pyx_t_2);
22107 __Pyx_INCREF(
function);
22108 __Pyx_DECREF_SET(__pyx_t_3,
function);
22111 __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4);
22112 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
22113 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
22114 if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1260, __pyx_L1_error)
22115 __Pyx_GOTREF(__pyx_t_1);
22116 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
22117 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
22118 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22119 __PYX_ERR(1, 1260, __pyx_L1_error)
22131 __Pyx_XDECREF(__pyx_t_1);
22132 __Pyx_XDECREF(__pyx_t_2);
22133 __Pyx_XDECREF(__pyx_t_3);
22134 __Pyx_XDECREF(__pyx_t_4);
22135 __Pyx_AddTraceback(
"View.MemoryView._err_dim", __pyx_clineno, __pyx_lineno, __pyx_filename);
22137 __Pyx_XDECREF(__pyx_v_error);
22138 __Pyx_TraceReturn(Py_None, 0);
22139 __Pyx_RefNannyFinishContext();
22141 __Pyx_PyGILState_Release(__pyx_gilstate_save);
22154 static int __pyx_memoryview_err(PyObject *__pyx_v_error,
char *__pyx_v_msg) {
22156 __Pyx_TraceDeclarations
22157 __Pyx_RefNannyDeclarations
22159 PyObject *__pyx_t_2 = NULL;
22160 PyObject *__pyx_t_3 = NULL;
22161 PyObject *__pyx_t_4 = NULL;
22162 PyObject *__pyx_t_5 = NULL;
22163 int __pyx_lineno = 0;
22164 const char *__pyx_filename = NULL;
22165 int __pyx_clineno = 0;
22167 PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
22169 __Pyx_RefNannySetupContext(
"_err", 0);
22170 __Pyx_TraceCall(
"_err", __pyx_f[1], 1263, 0, __PYX_ERR(1, 1263, __pyx_L1_error));
22171 __Pyx_INCREF(__pyx_v_error);
22180 __Pyx_TraceLine(1264,0,__PYX_ERR(1, 1264, __pyx_L1_error))
22181 __pyx_t_1 = ((__pyx_v_msg != NULL) != 0);
22182 if (unlikely(__pyx_t_1)) {
22191 __Pyx_TraceLine(1265,0,__PYX_ERR(1, 1265, __pyx_L1_error))
22192 __pyx_t_3 = __Pyx_decode_c_string(__pyx_v_msg, 0, strlen(__pyx_v_msg), NULL, NULL, PyUnicode_DecodeASCII);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1265, __pyx_L1_error)
22193 __Pyx_GOTREF(__pyx_t_3);
22194 __Pyx_INCREF(__pyx_v_error);
22195 __pyx_t_4 = __pyx_v_error; __pyx_t_5 = NULL;
22196 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
22197 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
22198 if (likely(__pyx_t_5)) {
22199 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_4);
22200 __Pyx_INCREF(__pyx_t_5);
22201 __Pyx_INCREF(
function);
22202 __Pyx_DECREF_SET(__pyx_t_4,
function);
22205 __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3);
22206 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
22207 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
22208 if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1265, __pyx_L1_error)
22209 __Pyx_GOTREF(__pyx_t_2);
22210 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
22211 __Pyx_Raise(__pyx_t_2, 0, 0, 0);
22212 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
22213 __PYX_ERR(1, 1265, __pyx_L1_error)
22231 __Pyx_TraceLine(1267,0,__PYX_ERR(1, 1267, __pyx_L1_error))
22233 __Pyx_Raise(__pyx_v_error, 0, 0, 0);
22234 __PYX_ERR(1, 1267, __pyx_L1_error)
22247 __Pyx_XDECREF(__pyx_t_2);
22248 __Pyx_XDECREF(__pyx_t_3);
22249 __Pyx_XDECREF(__pyx_t_4);
22250 __Pyx_XDECREF(__pyx_t_5);
22251 __Pyx_AddTraceback(
"View.MemoryView._err", __pyx_clineno, __pyx_lineno, __pyx_filename);
22253 __Pyx_XDECREF(__pyx_v_error);
22254 __Pyx_TraceReturn(Py_None, 0);
22255 __Pyx_RefNannyFinishContext();
22257 __Pyx_PyGILState_Release(__pyx_gilstate_save);
22270 static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_memviewslice __pyx_v_dst,
int __pyx_v_src_ndim,
int __pyx_v_dst_ndim,
int __pyx_v_dtype_is_object) {
22271 void *__pyx_v_tmpdata;
22272 size_t __pyx_v_itemsize;
22274 char __pyx_v_order;
22275 int __pyx_v_broadcasting;
22276 int __pyx_v_direct_copy;
22277 __Pyx_memviewslice __pyx_v_tmp;
22280 __Pyx_TraceDeclarations
22281 Py_ssize_t __pyx_t_1;
22289 int __pyx_lineno = 0;
22290 const char *__pyx_filename = NULL;
22291 int __pyx_clineno = 0;
22292 __Pyx_TraceCall(
"memoryview_copy_contents", __pyx_f[1], 1270, 1, __PYX_ERR(1, 1270, __pyx_L1_error));
22301 __Pyx_TraceLine(1278,1,__PYX_ERR(1, 1278, __pyx_L1_error))
22302 __pyx_v_tmpdata = NULL;
22311 __Pyx_TraceLine(1279,1,__PYX_ERR(1, 1279, __pyx_L1_error))
22312 __pyx_t_1 = __pyx_v_src.memview->view.itemsize;
22313 __pyx_v_itemsize = __pyx_t_1;
22322 __Pyx_TraceLine(1281,1,__PYX_ERR(1, 1281, __pyx_L1_error))
22323 __pyx_v_order = __pyx_get_best_slice_order((&__pyx_v_src), __pyx_v_src_ndim);
22332 __Pyx_TraceLine(1282,1,__PYX_ERR(1, 1282, __pyx_L1_error))
22333 __pyx_v_broadcasting = 0;
22342 __Pyx_TraceLine(1283,1,__PYX_ERR(1, 1283, __pyx_L1_error))
22343 __pyx_v_direct_copy = 0;
22352 __Pyx_TraceLine(1286,1,__PYX_ERR(1, 1286, __pyx_L1_error))
22353 __pyx_t_2 = ((__pyx_v_src_ndim < __pyx_v_dst_ndim) != 0);
22363 __Pyx_TraceLine(1287,1,__PYX_ERR(1, 1287, __pyx_L1_error))
22364 __pyx_memoryview_broadcast_leading((&__pyx_v_src), __pyx_v_src_ndim, __pyx_v_dst_ndim);
22383 __Pyx_TraceLine(1288,1,__PYX_ERR(1, 1288, __pyx_L1_error))
22384 __pyx_t_2 = ((__pyx_v_dst_ndim < __pyx_v_src_ndim) != 0);
22394 __Pyx_TraceLine(1289,1,__PYX_ERR(1, 1289, __pyx_L1_error))
22395 __pyx_memoryview_broadcast_leading((&__pyx_v_dst), __pyx_v_dst_ndim, __pyx_v_src_ndim);
22414 __Pyx_TraceLine(1291,1,__PYX_ERR(1, 1291, __pyx_L1_error))
22415 __pyx_t_3 = __pyx_v_dst_ndim;
22416 __pyx_t_4 = __pyx_v_src_ndim;
22417 if (((__pyx_t_3 > __pyx_t_4) != 0)) {
22418 __pyx_t_5 = __pyx_t_3;
22420 __pyx_t_5 = __pyx_t_4;
22422 __pyx_v_ndim = __pyx_t_5;
22431 __Pyx_TraceLine(1293,1,__PYX_ERR(1, 1293, __pyx_L1_error))
22432 __pyx_t_5 = __pyx_v_ndim;
22433 __pyx_t_3 = __pyx_t_5;
22434 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
22435 __pyx_v_i = __pyx_t_4;
22444 __Pyx_TraceLine(1294,1,__PYX_ERR(1, 1294, __pyx_L1_error))
22445 __pyx_t_2 = (((__pyx_v_src.shape[__pyx_v_i]) != (__pyx_v_dst.shape[__pyx_v_i])) != 0);
22455 __Pyx_TraceLine(1295,1,__PYX_ERR(1, 1295, __pyx_L1_error))
22456 __pyx_t_2 = (((__pyx_v_src.shape[__pyx_v_i]) == 1) != 0);
22466 __Pyx_TraceLine(1296,1,__PYX_ERR(1, 1296, __pyx_L1_error))
22467 __pyx_v_broadcasting = 1;
22476 __Pyx_TraceLine(1297,1,__PYX_ERR(1, 1297, __pyx_L1_error))
22477 (__pyx_v_src.strides[__pyx_v_i]) = 0;
22496 __Pyx_TraceLine(1299,1,__PYX_ERR(1, 1299, __pyx_L1_error))
22498 __pyx_t_6 = __pyx_memoryview_err_extents(__pyx_v_i, (__pyx_v_dst.shape[__pyx_v_i]), (__pyx_v_src.shape[__pyx_v_i]));
if (unlikely(__pyx_t_6 == ((
int)-1))) __PYX_ERR(1, 1299, __pyx_L1_error)
22518 __Pyx_TraceLine(1301,1,__PYX_ERR(1, 1301, __pyx_L1_error))
22519 __pyx_t_2 = (((__pyx_v_src.suboffsets[__pyx_v_i]) >= 0) != 0);
22529 __Pyx_TraceLine(1302,1,__PYX_ERR(1, 1302, __pyx_L1_error))
22530 __pyx_t_6 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, ((
char *)
"Dimension %d is not direct"), __pyx_v_i);
if (unlikely(__pyx_t_6 == ((
int)-1))) __PYX_ERR(1, 1302, __pyx_L1_error)
22549 __Pyx_TraceLine(1304,1,__PYX_ERR(1, 1304, __pyx_L1_error))
22550 __pyx_t_2 = (__pyx_slices_overlap((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize) != 0);
22560 __Pyx_TraceLine(1306,1,__PYX_ERR(1, 1306, __pyx_L1_error))
22561 __pyx_t_2 = ((!(__pyx_memviewslice_is_contig(__pyx_v_src, __pyx_v_order, __pyx_v_ndim) != 0)) != 0);
22571 __Pyx_TraceLine(1307,1,__PYX_ERR(1, 1307, __pyx_L1_error))
22572 __pyx_v_order = __pyx_get_best_slice_order((&__pyx_v_dst), __pyx_v_ndim);
22590 __Pyx_TraceLine(1309,1,__PYX_ERR(1, 1309, __pyx_L1_error))
22591 __pyx_t_7 = __pyx_memoryview_copy_data_to_temp((&__pyx_v_src), (&__pyx_v_tmp), __pyx_v_order, __pyx_v_ndim);
if (unlikely(__pyx_t_7 == ((
void *)NULL))) __PYX_ERR(1, 1309, __pyx_L1_error)
22592 __pyx_v_tmpdata = __pyx_t_7;
22601 __Pyx_TraceLine(1310,1,__PYX_ERR(1, 1310, __pyx_L1_error))
22602 __pyx_v_src = __pyx_v_tmp;
22620 __Pyx_TraceLine(1312,1,__PYX_ERR(1, 1312, __pyx_L1_error))
22621 __pyx_t_2 = ((!(__pyx_v_broadcasting != 0)) != 0);
22631 __Pyx_TraceLine(1315,1,__PYX_ERR(1, 1315, __pyx_L1_error))
22632 __pyx_t_2 = (__pyx_memviewslice_is_contig(__pyx_v_src,
'C', __pyx_v_ndim) != 0);
22642 __Pyx_TraceLine(1316,1,__PYX_ERR(1, 1316, __pyx_L1_error))
22643 __pyx_v_direct_copy = __pyx_memviewslice_is_contig(__pyx_v_dst,
'C', __pyx_v_ndim);
22662 __Pyx_TraceLine(1317,1,__PYX_ERR(1, 1317, __pyx_L1_error))
22663 __pyx_t_2 = (__pyx_memviewslice_is_contig(__pyx_v_src,
'F', __pyx_v_ndim) != 0);
22673 __Pyx_TraceLine(1318,1,__PYX_ERR(1, 1318, __pyx_L1_error))
22674 __pyx_v_direct_copy = __pyx_memviewslice_is_contig(__pyx_v_dst,
'F', __pyx_v_ndim);
22693 __Pyx_TraceLine(1320,1,__PYX_ERR(1, 1320, __pyx_L1_error))
22694 __pyx_t_2 = (__pyx_v_direct_copy != 0);
22704 __Pyx_TraceLine(1322,1,__PYX_ERR(1, 1322, __pyx_L1_error))
22705 __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
22714 __Pyx_TraceLine(1323,1,__PYX_ERR(1, 1323, __pyx_L1_error))
22715 (void)(memcpy(__pyx_v_dst.data, __pyx_v_src.data, __pyx_memoryview_slice_get_size((&__pyx_v_src), __pyx_v_ndim)));
22724 __Pyx_TraceLine(1324,1,__PYX_ERR(1, 1324, __pyx_L1_error))
22725 __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
22734 __Pyx_TraceLine(1325,1,__PYX_ERR(1, 1325, __pyx_L1_error))
22735 free(__pyx_v_tmpdata);
22744 __Pyx_TraceLine(1326,1,__PYX_ERR(1, 1326, __pyx_L1_error))
22773 __Pyx_TraceLine(1328,1,__PYX_ERR(1, 1328, __pyx_L1_error))
22774 __pyx_t_2 = (__pyx_v_order ==
'F');
22776 __pyx_t_2 = (
'F' == __pyx_get_best_slice_order((&__pyx_v_dst), __pyx_v_ndim));
22778 __pyx_t_8 = (__pyx_t_2 != 0);
22788 __Pyx_TraceLine(1331,1,__PYX_ERR(1, 1331, __pyx_L1_error))
22789 __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_src));
if (unlikely(__pyx_t_5 == ((
int)0))) __PYX_ERR(1, 1331, __pyx_L1_error)
22798 __Pyx_TraceLine(1332,1,__PYX_ERR(1, 1332, __pyx_L1_error))
22799 __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_dst));
if (unlikely(__pyx_t_5 == ((
int)0))) __PYX_ERR(1, 1332, __pyx_L1_error)
22817 __Pyx_TraceLine(1334,1,__PYX_ERR(1, 1334, __pyx_L1_error))
22818 __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
22827 __Pyx_TraceLine(1335,1,__PYX_ERR(1, 1335, __pyx_L1_error))
22828 copy_strided_to_strided((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize);
22837 __Pyx_TraceLine(1336,1,__PYX_ERR(1, 1336, __pyx_L1_error))
22838 __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
22847 __Pyx_TraceLine(1338,1,__PYX_ERR(1, 1338, __pyx_L1_error))
22848 free(__pyx_v_tmpdata);
22857 __Pyx_TraceLine(1339,1,__PYX_ERR(1, 1339, __pyx_L1_error))
22873 PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
22875 __Pyx_AddTraceback(
"View.MemoryView.memoryview_copy_contents", __pyx_clineno, __pyx_lineno, __pyx_filename);
22877 __Pyx_PyGILState_Release(__pyx_gilstate_save);
22882 __Pyx_TraceReturn(Py_None, 1);
22894 static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_mslice,
int __pyx_v_ndim,
int __pyx_v_ndim_other) {
22896 int __pyx_v_offset;
22897 __Pyx_TraceDeclarations
22901 int __pyx_lineno = 0;
22902 const char *__pyx_filename = NULL;
22903 int __pyx_clineno = 0;
22904 __Pyx_TraceCall(
"broadcast_leading", __pyx_f[1], 1342, 1, __PYX_ERR(1, 1342, __pyx_L1_error));
22913 __Pyx_TraceLine(1346,1,__PYX_ERR(1, 1346, __pyx_L1_error))
22914 __pyx_v_offset = (__pyx_v_ndim_other - __pyx_v_ndim);
22923 __Pyx_TraceLine(1348,1,__PYX_ERR(1, 1348, __pyx_L1_error))
22924 for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1; __pyx_t_1-=1) {
22925 __pyx_v_i = __pyx_t_1;
22934 __Pyx_TraceLine(1349,1,__PYX_ERR(1, 1349, __pyx_L1_error))
22935 (__pyx_v_mslice->shape[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->shape[__pyx_v_i]);
22944 __Pyx_TraceLine(1350,1,__PYX_ERR(1, 1350, __pyx_L1_error))
22945 (__pyx_v_mslice->strides[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->strides[__pyx_v_i]);
22954 __Pyx_TraceLine(1351,1,__PYX_ERR(1, 1351, __pyx_L1_error))
22955 (__pyx_v_mslice->suboffsets[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->suboffsets[__pyx_v_i]);
22965 __Pyx_TraceLine(1353,1,__PYX_ERR(1, 1353, __pyx_L1_error))
22966 __pyx_t_1 = __pyx_v_offset;
22967 __pyx_t_2 = __pyx_t_1;
22968 for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
22969 __pyx_v_i = __pyx_t_3;
22978 __Pyx_TraceLine(1354,1,__PYX_ERR(1, 1354, __pyx_L1_error))
22979 (__pyx_v_mslice->shape[__pyx_v_i]) = 1;
22988 __Pyx_TraceLine(1355,1,__PYX_ERR(1, 1355, __pyx_L1_error))
22989 (__pyx_v_mslice->strides[__pyx_v_i]) = (__pyx_v_mslice->strides[0]);
22998 __Pyx_TraceLine(1356,1,__PYX_ERR(1, 1356, __pyx_L1_error))
22999 (__pyx_v_mslice->suboffsets[__pyx_v_i]) = -1L;
23013 __Pyx_WriteUnraisable(
"View.MemoryView.broadcast_leading", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
23015 __Pyx_TraceReturn(Py_None, 1);
23026 static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *__pyx_v_dst,
int __pyx_v_dtype_is_object,
int __pyx_v_ndim,
int __pyx_v_inc) {
23027 __Pyx_TraceDeclarations
23029 int __pyx_lineno = 0;
23030 const char *__pyx_filename = NULL;
23031 int __pyx_clineno = 0;
23032 __Pyx_TraceCall(
"refcount_copying", __pyx_f[1], 1364, 1, __PYX_ERR(1, 1364, __pyx_L1_error));
23041 __Pyx_TraceLine(1368,1,__PYX_ERR(1, 1368, __pyx_L1_error))
23042 __pyx_t_1 = (__pyx_v_dtype_is_object != 0);
23052 __Pyx_TraceLine(1369,1,__PYX_ERR(1, 1369, __pyx_L1_error))
23053 __pyx_memoryview_refcount_objects_in_slice_with_gil(__pyx_v_dst->data, __pyx_v_dst->shape, __pyx_v_dst->strides, __pyx_v_ndim, __pyx_v_inc);
23075 __Pyx_WriteUnraisable(
"View.MemoryView.refcount_copying", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
23077 __Pyx_TraceReturn(Py_None, 1);
23088 static void __pyx_memoryview_refcount_objects_in_slice_with_gil(
char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides,
int __pyx_v_ndim,
int __pyx_v_inc) {
23089 __Pyx_TraceDeclarations
23090 __Pyx_RefNannyDeclarations
23091 int __pyx_lineno = 0;
23092 const char *__pyx_filename = NULL;
23093 int __pyx_clineno = 0;
23095 PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
23097 __Pyx_RefNannySetupContext(
"refcount_objects_in_slice_with_gil", 0);
23098 __Pyx_TraceCall(
"refcount_objects_in_slice_with_gil", __pyx_f[1], 1373, 0, __PYX_ERR(1, 1373, __pyx_L1_error));
23107 __Pyx_TraceLine(1376,0,__PYX_ERR(1, 1376, __pyx_L1_error))
23108 __pyx_memoryview_refcount_objects_in_slice(__pyx_v_data, __pyx_v_shape, __pyx_v_strides, __pyx_v_ndim, __pyx_v_inc);
23121 __Pyx_WriteUnraisable(
"View.MemoryView.refcount_objects_in_slice_with_gil", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
23123 __Pyx_TraceReturn(Py_None, 0);
23124 __Pyx_RefNannyFinishContext();
23126 __Pyx_PyGILState_Release(__pyx_gilstate_save);
23138 static void __pyx_memoryview_refcount_objects_in_slice(
char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides,
int __pyx_v_ndim,
int __pyx_v_inc) {
23139 CYTHON_UNUSED Py_ssize_t __pyx_v_i;
23140 __Pyx_TraceDeclarations
23141 __Pyx_RefNannyDeclarations
23142 Py_ssize_t __pyx_t_1;
23143 Py_ssize_t __pyx_t_2;
23144 Py_ssize_t __pyx_t_3;
23146 int __pyx_lineno = 0;
23147 const char *__pyx_filename = NULL;
23148 int __pyx_clineno = 0;
23149 __Pyx_RefNannySetupContext(
"refcount_objects_in_slice", 0);
23150 __Pyx_TraceCall(
"refcount_objects_in_slice", __pyx_f[1], 1379, 0, __PYX_ERR(1, 1379, __pyx_L1_error));
23159 __Pyx_TraceLine(1383,0,__PYX_ERR(1, 1383, __pyx_L1_error))
23160 __pyx_t_1 = (__pyx_v_shape[0]);
23161 __pyx_t_2 = __pyx_t_1;
23162 for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
23163 __pyx_v_i = __pyx_t_3;
23172 __Pyx_TraceLine(1384,0,__PYX_ERR(1, 1384, __pyx_L1_error))
23173 __pyx_t_4 = ((__pyx_v_ndim == 1) != 0);
23183 __Pyx_TraceLine(1385,0,__PYX_ERR(1, 1385, __pyx_L1_error))
23184 __pyx_t_4 = (__pyx_v_inc != 0);
23194 __Pyx_TraceLine(1386,0,__PYX_ERR(1, 1386, __pyx_L1_error))
23195 Py_INCREF((((PyObject **)__pyx_v_data)[0]));
23214 __Pyx_TraceLine(1388,0,__PYX_ERR(1, 1388, __pyx_L1_error))
23216 Py_DECREF((((PyObject **)__pyx_v_data)[0]));
23237 __Pyx_TraceLine(1390,0,__PYX_ERR(1, 1390, __pyx_L1_error))
23247 __Pyx_TraceLine(1391,0,__PYX_ERR(1, 1391, __pyx_L1_error))
23248 __pyx_memoryview_refcount_objects_in_slice(__pyx_v_data, (__pyx_v_shape + 1), (__pyx_v_strides + 1), (__pyx_v_ndim - 1), __pyx_v_inc);
23259 __Pyx_TraceLine(1393,0,__PYX_ERR(1, 1393, __pyx_L1_error))
23260 __pyx_v_data = (__pyx_v_data + (__pyx_v_strides[0]));
23274 __Pyx_WriteUnraisable(
"View.MemoryView.refcount_objects_in_slice", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
23276 __Pyx_TraceReturn(Py_None, 0);
23277 __Pyx_RefNannyFinishContext();
23288 static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *__pyx_v_dst,
int __pyx_v_ndim,
size_t __pyx_v_itemsize,
void *__pyx_v_item,
int __pyx_v_dtype_is_object) {
23289 __Pyx_TraceDeclarations
23290 int __pyx_lineno = 0;
23291 const char *__pyx_filename = NULL;
23292 int __pyx_clineno = 0;
23293 __Pyx_TraceCall(
"slice_assign_scalar", __pyx_f[1], 1399, 1, __PYX_ERR(1, 1399, __pyx_L1_error));
23302 __Pyx_TraceLine(1402,1,__PYX_ERR(1, 1402, __pyx_L1_error))
23303 __pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
23312 __Pyx_TraceLine(1403,1,__PYX_ERR(1, 1403, __pyx_L1_error))
23313 __pyx_memoryview__slice_assign_scalar(__pyx_v_dst->data, __pyx_v_dst->shape, __pyx_v_dst->strides, __pyx_v_ndim, __pyx_v_itemsize, __pyx_v_item);
23322 __Pyx_TraceLine(1405,1,__PYX_ERR(1, 1405, __pyx_L1_error))
23323 __pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
23336 __Pyx_WriteUnraisable(
"View.MemoryView.slice_assign_scalar", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
23338 __Pyx_TraceReturn(Py_None, 1);
23349 static void __pyx_memoryview__slice_assign_scalar(
char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides,
int __pyx_v_ndim,
size_t __pyx_v_itemsize,
void *__pyx_v_item) {
23350 CYTHON_UNUSED Py_ssize_t __pyx_v_i;
23351 Py_ssize_t __pyx_v_stride;
23352 Py_ssize_t __pyx_v_extent;
23353 __Pyx_TraceDeclarations
23355 Py_ssize_t __pyx_t_2;
23356 Py_ssize_t __pyx_t_3;
23357 Py_ssize_t __pyx_t_4;
23358 int __pyx_lineno = 0;
23359 const char *__pyx_filename = NULL;
23360 int __pyx_clineno = 0;
23361 __Pyx_TraceCall(
"_slice_assign_scalar", __pyx_f[1], 1409, 1, __PYX_ERR(1, 1409, __pyx_L1_error));
23370 __Pyx_TraceLine(1413,1,__PYX_ERR(1, 1413, __pyx_L1_error))
23371 __pyx_v_stride = (__pyx_v_strides[0]);
23380 __Pyx_TraceLine(1414,1,__PYX_ERR(1, 1414, __pyx_L1_error))
23381 __pyx_v_extent = (__pyx_v_shape[0]);
23390 __Pyx_TraceLine(1416,1,__PYX_ERR(1, 1416, __pyx_L1_error))
23391 __pyx_t_1 = ((__pyx_v_ndim == 1) != 0);
23401 __Pyx_TraceLine(1417,1,__PYX_ERR(1, 1417, __pyx_L1_error))
23402 __pyx_t_2 = __pyx_v_extent;
23403 __pyx_t_3 = __pyx_t_2;
23404 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
23405 __pyx_v_i = __pyx_t_4;
23414 __Pyx_TraceLine(1418,1,__PYX_ERR(1, 1418, __pyx_L1_error))
23415 (void)(memcpy(__pyx_v_data, __pyx_v_item, __pyx_v_itemsize));
23424 __Pyx_TraceLine(1419,1,__PYX_ERR(1, 1419, __pyx_L1_error))
23425 __pyx_v_data = (__pyx_v_data + __pyx_v_stride);
23445 __Pyx_TraceLine(1421,1,__PYX_ERR(1, 1421, __pyx_L1_error))
23447 __pyx_t_2 = __pyx_v_extent;
23448 __pyx_t_3 = __pyx_t_2;
23449 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
23450 __pyx_v_i = __pyx_t_4;
23459 __Pyx_TraceLine(1422,1,__PYX_ERR(1, 1422, __pyx_L1_error))
23460 __pyx_memoryview__slice_assign_scalar(__pyx_v_data, (__pyx_v_shape + 1), (__pyx_v_strides + 1), (__pyx_v_ndim - 1), __pyx_v_itemsize, __pyx_v_item);
23469 __Pyx_TraceLine(1424,1,__PYX_ERR(1, 1424, __pyx_L1_error))
23470 __pyx_v_data = (__pyx_v_data + __pyx_v_stride);
23486 __Pyx_WriteUnraisable(
"View.MemoryView._slice_assign_scalar", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
23488 __Pyx_TraceReturn(Py_None, 1);
23498 static PyObject *__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
23499 static PyMethodDef __pyx_mdef_15View_dot_MemoryView_1__pyx_unpickle_Enum = {
"__pyx_unpickle_Enum", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum, METH_VARARGS|METH_KEYWORDS, 0};
23500 static PyObject *__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
23501 PyObject *__pyx_v___pyx_type = 0;
23502 long __pyx_v___pyx_checksum;
23503 PyObject *__pyx_v___pyx_state = 0;
23504 int __pyx_lineno = 0;
23505 const char *__pyx_filename = NULL;
23506 int __pyx_clineno = 0;
23507 PyObject *__pyx_r = 0;
23508 __Pyx_RefNannyDeclarations
23509 __Pyx_RefNannySetupContext(
"__pyx_unpickle_Enum (wrapper)", 0);
23511 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0};
23512 PyObject* values[3] = {0,0,0};
23513 if (unlikely(__pyx_kwds)) {
23514 Py_ssize_t kw_args;
23515 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
23516 switch (pos_args) {
23517 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
23518 CYTHON_FALLTHROUGH;
23519 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
23520 CYTHON_FALLTHROUGH;
23521 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
23522 CYTHON_FALLTHROUGH;
23524 default:
goto __pyx_L5_argtuple_error;
23526 kw_args = PyDict_Size(__pyx_kwds);
23527 switch (pos_args) {
23529 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--;
23530 else goto __pyx_L5_argtuple_error;
23531 CYTHON_FALLTHROUGH;
23533 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_checksum)) != 0)) kw_args--;
23535 __Pyx_RaiseArgtupleInvalid(
"__pyx_unpickle_Enum", 1, 3, 3, 1); __PYX_ERR(1, 1, __pyx_L3_error)
23537 CYTHON_FALLTHROUGH;
23539 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_state)) != 0)) kw_args--;
23541 __Pyx_RaiseArgtupleInvalid(
"__pyx_unpickle_Enum", 1, 3, 3, 2); __PYX_ERR(1, 1, __pyx_L3_error)
23544 if (unlikely(kw_args > 0)) {
23545 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"__pyx_unpickle_Enum") < 0)) __PYX_ERR(1, 1, __pyx_L3_error)
23547 }
else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
23548 goto __pyx_L5_argtuple_error;
23550 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
23551 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
23552 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
23554 __pyx_v___pyx_type = values[0];
23555 __pyx_v___pyx_checksum = __Pyx_PyInt_As_long(values[1]);
if (unlikely((__pyx_v___pyx_checksum == (
long)-1) && PyErr_Occurred())) __PYX_ERR(1, 1, __pyx_L3_error)
23556 __pyx_v___pyx_state = values[2];
23558 goto __pyx_L4_argument_unpacking_done;
23559 __pyx_L5_argtuple_error:;
23560 __Pyx_RaiseArgtupleInvalid(
"__pyx_unpickle_Enum", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 1, __pyx_L3_error)
23562 __Pyx_AddTraceback(
"View.MemoryView.__pyx_unpickle_Enum", __pyx_clineno, __pyx_lineno, __pyx_filename);
23563 __Pyx_RefNannyFinishContext();
23565 __pyx_L4_argument_unpacking_done:;
23566 __pyx_r = __pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state);
23569 __Pyx_RefNannyFinishContext();
23573 static PyObject *__pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type,
long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) {
23574 PyObject *__pyx_v___pyx_PickleError = 0;
23575 PyObject *__pyx_v___pyx_result = 0;
23576 PyObject *__pyx_r = NULL;
23577 __Pyx_TraceDeclarations
23578 __Pyx_RefNannyDeclarations
23579 PyObject *__pyx_t_1 = NULL;
23582 PyObject *__pyx_t_4 = NULL;
23583 PyObject *__pyx_t_5 = NULL;
23584 PyObject *__pyx_t_6 = NULL;
23585 int __pyx_lineno = 0;
23586 const char *__pyx_filename = NULL;
23587 int __pyx_clineno = 0;
23588 __Pyx_TraceFrameInit(__pyx_codeobj__25)
23589 __Pyx_RefNannySetupContext(
"__pyx_unpickle_Enum", 0);
23590 __Pyx_TraceCall(
"__pyx_unpickle_Enum", __pyx_f[1], 1, 0, __PYX_ERR(1, 1, __pyx_L1_error));
23599 __Pyx_TraceLine(4,0,__PYX_ERR(1, 4, __pyx_L1_error))
23600 __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
23601 __Pyx_GOTREF(__pyx_t_1);
23602 __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_t_1, __pyx_tuple__26, Py_NE));
if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(1, 4, __pyx_L1_error)
23603 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23604 __pyx_t_3 = (__pyx_t_2 != 0);
23614 __Pyx_TraceLine(5,0,__PYX_ERR(1, 5, __pyx_L1_error))
23615 __pyx_t_1 = PyList_New(1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error)
23616 __Pyx_GOTREF(__pyx_t_1);
23617 __Pyx_INCREF(__pyx_n_s_PickleError);
23618 __Pyx_GIVEREF(__pyx_n_s_PickleError);
23619 PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_PickleError);
23620 __pyx_t_4 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_1, 0);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 5, __pyx_L1_error)
23621 __Pyx_GOTREF(__pyx_t_4);
23622 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23623 __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_4, __pyx_n_s_PickleError);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error)
23624 __Pyx_GOTREF(__pyx_t_1);
23625 __Pyx_INCREF(__pyx_t_1);
23626 __pyx_v___pyx_PickleError = __pyx_t_1;
23627 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23628 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
23637 __Pyx_TraceLine(6,0,__PYX_ERR(1, 6, __pyx_L1_error))
23638 __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 6, __pyx_L1_error)
23639 __Pyx_GOTREF(__pyx_t_1);
23640 __pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_0x_x_vs_0, __pyx_t_1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 6, __pyx_L1_error)
23641 __Pyx_GOTREF(__pyx_t_5);
23642 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23643 __Pyx_INCREF(__pyx_v___pyx_PickleError);
23644 __pyx_t_1 = __pyx_v___pyx_PickleError; __pyx_t_6 = NULL;
23645 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
23646 __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_1);
23647 if (likely(__pyx_t_6)) {
23648 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_1);
23649 __Pyx_INCREF(__pyx_t_6);
23650 __Pyx_INCREF(
function);
23651 __Pyx_DECREF_SET(__pyx_t_1,
function);
23654 __pyx_t_4 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_6, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_5);
23655 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
23656 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
23657 if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 6, __pyx_L1_error)
23658 __Pyx_GOTREF(__pyx_t_4);
23659 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23660 __Pyx_Raise(__pyx_t_4, 0, 0, 0);
23661 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
23662 __PYX_ERR(1, 6, __pyx_L1_error)
23680 __Pyx_TraceLine(7,0,__PYX_ERR(1, 7, __pyx_L1_error))
23681 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_MemviewEnum_type), __pyx_n_s_new);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 7, __pyx_L1_error)
23682 __Pyx_GOTREF(__pyx_t_1);
23684 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
23685 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1);
23686 if (likely(__pyx_t_5)) {
23687 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_1);
23688 __Pyx_INCREF(__pyx_t_5);
23689 __Pyx_INCREF(
function);
23690 __Pyx_DECREF_SET(__pyx_t_1,
function);
23693 __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_5, __pyx_v___pyx_type) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v___pyx_type);
23694 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
23695 if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 7, __pyx_L1_error)
23696 __Pyx_GOTREF(__pyx_t_4);
23697 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23698 __pyx_v___pyx_result = __pyx_t_4;
23708 __Pyx_TraceLine(8,0,__PYX_ERR(1, 8, __pyx_L1_error))
23709 __pyx_t_3 = (__pyx_v___pyx_state != Py_None);
23710 __pyx_t_2 = (__pyx_t_3 != 0);
23720 __Pyx_TraceLine(9,0,__PYX_ERR(1, 9, __pyx_L1_error))
23721 if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||((
void)PyErr_Format(PyExc_TypeError,
"Expected %.16s, got %.200s",
"tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 9, __pyx_L1_error)
23722 __pyx_t_4 = __pyx_unpickle_Enum__set_state(((
struct __pyx_MemviewEnum_obj *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state));
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 9, __pyx_L1_error)
23723 __Pyx_GOTREF(__pyx_t_4);
23724 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
23742 __Pyx_TraceLine(10,0,__PYX_ERR(1, 10, __pyx_L1_error))
23743 __Pyx_XDECREF(__pyx_r);
23744 __Pyx_INCREF(__pyx_v___pyx_result);
23745 __pyx_r = __pyx_v___pyx_result;
23756 __Pyx_XDECREF(__pyx_t_1);
23757 __Pyx_XDECREF(__pyx_t_4);
23758 __Pyx_XDECREF(__pyx_t_5);
23759 __Pyx_XDECREF(__pyx_t_6);
23760 __Pyx_AddTraceback(
"View.MemoryView.__pyx_unpickle_Enum", __pyx_clineno, __pyx_lineno, __pyx_filename);
23763 __Pyx_XDECREF(__pyx_v___pyx_PickleError);
23764 __Pyx_XDECREF(__pyx_v___pyx_result);
23765 __Pyx_XGIVEREF(__pyx_r);
23766 __Pyx_TraceReturn(__pyx_r, 0);
23767 __Pyx_RefNannyFinishContext();
23779 static PyObject *__pyx_unpickle_Enum__set_state(
struct __pyx_MemviewEnum_obj *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) {
23780 PyObject *__pyx_r = NULL;
23781 __Pyx_TraceDeclarations
23782 __Pyx_RefNannyDeclarations
23783 PyObject *__pyx_t_1 = NULL;
23785 Py_ssize_t __pyx_t_3;
23788 PyObject *__pyx_t_6 = NULL;
23789 PyObject *__pyx_t_7 = NULL;
23790 PyObject *__pyx_t_8 = NULL;
23791 int __pyx_lineno = 0;
23792 const char *__pyx_filename = NULL;
23793 int __pyx_clineno = 0;
23794 __Pyx_RefNannySetupContext(
"__pyx_unpickle_Enum__set_state", 0);
23795 __Pyx_TraceCall(
"__pyx_unpickle_Enum__set_state", __pyx_f[1], 11, 0, __PYX_ERR(1, 11, __pyx_L1_error));
23804 __Pyx_TraceLine(12,0,__PYX_ERR(1, 12, __pyx_L1_error))
23805 if (unlikely(__pyx_v___pyx_state == Py_None)) {
23806 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
23807 __PYX_ERR(1, 12, __pyx_L1_error)
23809 __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0,
long, 1, __Pyx_PyInt_From_long, 0, 0, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
23810 __Pyx_GOTREF(__pyx_t_1);
23811 __Pyx_GIVEREF(__pyx_t_1);
23812 __Pyx_GOTREF(__pyx_v___pyx_result->name);
23813 __Pyx_DECREF(__pyx_v___pyx_result->name);
23814 __pyx_v___pyx_result->name = __pyx_t_1;
23823 __Pyx_TraceLine(13,0,__PYX_ERR(1, 13, __pyx_L1_error))
23824 if (unlikely(__pyx_v___pyx_state == Py_None)) {
23825 PyErr_SetString(PyExc_TypeError,
"object of type 'NoneType' has no len()");
23826 __PYX_ERR(1, 13, __pyx_L1_error)
23828 __pyx_t_3 = PyTuple_GET_SIZE(__pyx_v___pyx_state);
if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(1, 13, __pyx_L1_error)
23829 __pyx_t_4 = ((__pyx_t_3 > 1) != 0);
23832 __pyx_t_2 = __pyx_t_4;
23833 goto __pyx_L4_bool_binop_done;
23835 __pyx_t_4 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict);
if (unlikely(__pyx_t_4 == ((
int)-1))) __PYX_ERR(1, 13, __pyx_L1_error)
23836 __pyx_t_5 = (__pyx_t_4 != 0);
23837 __pyx_t_2 = __pyx_t_5;
23838 __pyx_L4_bool_binop_done:;
23846 __Pyx_TraceLine(14,0,__PYX_ERR(1, 14, __pyx_L1_error))
23847 __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict);
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 14, __pyx_L1_error)
23848 __Pyx_GOTREF(__pyx_t_6);
23849 __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_update);
if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 14, __pyx_L1_error)
23850 __Pyx_GOTREF(__pyx_t_7);
23851 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
23852 if (unlikely(__pyx_v___pyx_state == Py_None)) {
23853 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
23854 __PYX_ERR(1, 14, __pyx_L1_error)
23856 __pyx_t_6 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1,
long, 1, __Pyx_PyInt_From_long, 0, 0, 0);
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 14, __pyx_L1_error)
23857 __Pyx_GOTREF(__pyx_t_6);
23859 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
23860 __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7);
23861 if (likely(__pyx_t_8)) {
23862 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_7);
23863 __Pyx_INCREF(__pyx_t_8);
23864 __Pyx_INCREF(
function);
23865 __Pyx_DECREF_SET(__pyx_t_7,
function);
23868 __pyx_t_1 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_8, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6);
23869 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
23870 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
23871 if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 14, __pyx_L1_error)
23872 __Pyx_GOTREF(__pyx_t_1);
23873 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
23874 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23893 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
23896 __Pyx_XDECREF(__pyx_t_1);
23897 __Pyx_XDECREF(__pyx_t_6);
23898 __Pyx_XDECREF(__pyx_t_7);
23899 __Pyx_XDECREF(__pyx_t_8);
23900 __Pyx_AddTraceback(
"View.MemoryView.__pyx_unpickle_Enum__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename);
23903 __Pyx_XGIVEREF(__pyx_r);
23904 __Pyx_TraceReturn(__pyx_r, 0);
23905 __Pyx_RefNannyFinishContext();
23908 static struct __pyx_vtabstruct_array __pyx_vtable_array;
23910 static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k) {
23911 struct __pyx_array_obj *p;
23913 if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
23914 o = (*t->tp_alloc)(t, 0);
23916 o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
23918 if (unlikely(!o))
return 0;
23919 p = ((
struct __pyx_array_obj *)o);
23920 p->__pyx_vtab = __pyx_vtabptr_array;
23921 p->mode = ((PyObject*)Py_None); Py_INCREF(Py_None);
23922 p->_format = ((PyObject*)Py_None); Py_INCREF(Py_None);
23923 if (unlikely(__pyx_array___cinit__(o, a, k) < 0))
goto bad;
23926 Py_DECREF(o); o = 0;
23930 static void __pyx_tp_dealloc_array(PyObject *o) {
23931 struct __pyx_array_obj *p = (
struct __pyx_array_obj *)o;
23932 #if CYTHON_USE_TP_FINALIZE
23933 if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !__Pyx_PyObject_GC_IsFinalized(o))) {
23934 if (PyObject_CallFinalizerFromDealloc(o))
return;
23938 PyObject *etype, *eval, *etb;
23939 PyErr_Fetch(&etype, &eval, &etb);
23940 __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1);
23941 __pyx_array___dealloc__(o);
23942 __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1);
23943 PyErr_Restore(etype, eval, etb);
23946 Py_CLEAR(p->_format);
23947 (*Py_TYPE(o)->tp_free)(o);
23949 static PyObject *__pyx_sq_item_array(PyObject *o, Py_ssize_t i) {
23951 PyObject *x = PyInt_FromSsize_t(i);
if(!x)
return 0;
23952 r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
23957 static int __pyx_mp_ass_subscript_array(PyObject *o, PyObject *i, PyObject *v) {
23959 return __pyx_array___setitem__(o, i, v);
23962 PyErr_Format(PyExc_NotImplementedError,
23963 "Subscript deletion not supported by %.200s", Py_TYPE(o)->tp_name);
23968 static PyObject *__pyx_tp_getattro_array(PyObject *o, PyObject *n) {
23969 PyObject *v = __Pyx_PyObject_GenericGetAttr(o, n);
23970 if (!v && PyErr_ExceptionMatches(PyExc_AttributeError)) {
23972 v = __pyx_array___getattr__(o, n);
23977 static PyObject *__pyx_getprop___pyx_array_memview(PyObject *o, CYTHON_UNUSED
void *x) {
23978 return __pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(o);
23981 static PyMethodDef __pyx_methods_array[] = {
23982 {
"__getattr__", (PyCFunction)__pyx_array___getattr__, METH_O|METH_COEXIST, 0},
23983 {
"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_array_1__reduce_cython__, METH_NOARGS, 0},
23984 {
"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_array_3__setstate_cython__, METH_O, 0},
23988 static struct PyGetSetDef __pyx_getsets_array[] = {
23989 {(
char *)
"memview", __pyx_getprop___pyx_array_memview, 0, (
char *)0, 0},
23993 static PySequenceMethods __pyx_tp_as_sequence_array = {
23994 __pyx_array___len__,
23997 __pyx_sq_item_array,
24006 static PyMappingMethods __pyx_tp_as_mapping_array = {
24007 __pyx_array___len__,
24008 __pyx_array___getitem__,
24009 __pyx_mp_ass_subscript_array,
24012 static PyBufferProcs __pyx_tp_as_buffer_array = {
24013 #if PY_MAJOR_VERSION < 3
24016 #if PY_MAJOR_VERSION < 3
24019 #if PY_MAJOR_VERSION < 3
24022 #if PY_MAJOR_VERSION < 3
24025 __pyx_array_getbuffer,
24029 static PyTypeObject __pyx_type___pyx_array = {
24030 PyVarObject_HEAD_INIT(0, 0)
24031 "imate.traceinv._hutchinson_method.array",
24032 sizeof(
struct __pyx_array_obj),
24034 __pyx_tp_dealloc_array,
24035 #
if PY_VERSION_HEX < 0x030800b4
24038 #
if PY_VERSION_HEX >= 0x030800b4
24043 #
if PY_MAJOR_VERSION < 3
24046 #
if PY_MAJOR_VERSION >= 3
24051 &__pyx_tp_as_sequence_array,
24052 &__pyx_tp_as_mapping_array,
24056 __pyx_tp_getattro_array,
24058 &__pyx_tp_as_buffer_array,
24059 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE,
24067 __pyx_methods_array,
24069 __pyx_getsets_array,
24077 __pyx_tp_new_array,
24087 #
if PY_VERSION_HEX >= 0x030400a1
24090 #
if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
24093 #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
24096 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
24101 static PyObject *__pyx_tp_new_Enum(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
24102 struct __pyx_MemviewEnum_obj *p;
24104 if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
24105 o = (*t->tp_alloc)(t, 0);
24107 o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
24109 if (unlikely(!o))
return 0;
24110 p = ((
struct __pyx_MemviewEnum_obj *)o);
24111 p->name = Py_None; Py_INCREF(Py_None);
24115 static void __pyx_tp_dealloc_Enum(PyObject *o) {
24116 struct __pyx_MemviewEnum_obj *p = (
struct __pyx_MemviewEnum_obj *)o;
24117 #if CYTHON_USE_TP_FINALIZE
24118 if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !__Pyx_PyObject_GC_IsFinalized(o)) {
24119 if (PyObject_CallFinalizerFromDealloc(o))
return;
24122 PyObject_GC_UnTrack(o);
24124 (*Py_TYPE(o)->tp_free)(o);
24127 static int __pyx_tp_traverse_Enum(PyObject *o, visitproc v,
void *a) {
24129 struct __pyx_MemviewEnum_obj *p = (
struct __pyx_MemviewEnum_obj *)o;
24131 e = (*v)(p->name, a);
if (e)
return e;
24136 static int __pyx_tp_clear_Enum(PyObject *o) {
24138 struct __pyx_MemviewEnum_obj *p = (
struct __pyx_MemviewEnum_obj *)o;
24139 tmp = ((PyObject*)p->name);
24140 p->name = Py_None; Py_INCREF(Py_None);
24145 static PyMethodDef __pyx_methods_Enum[] = {
24146 {
"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_MemviewEnum_1__reduce_cython__, METH_NOARGS, 0},
24147 {
"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_MemviewEnum_3__setstate_cython__, METH_O, 0},
24151 static PyTypeObject __pyx_type___pyx_MemviewEnum = {
24152 PyVarObject_HEAD_INIT(0, 0)
24153 "imate.traceinv._hutchinson_method.Enum",
24154 sizeof(
struct __pyx_MemviewEnum_obj),
24156 __pyx_tp_dealloc_Enum,
24157 #
if PY_VERSION_HEX < 0x030800b4
24160 #
if PY_VERSION_HEX >= 0x030800b4
24165 #
if PY_MAJOR_VERSION < 3
24168 #
if PY_MAJOR_VERSION >= 3
24171 __pyx_MemviewEnum___repr__,
24181 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC,
24183 __pyx_tp_traverse_Enum,
24184 __pyx_tp_clear_Enum,
24189 __pyx_methods_Enum,
24197 __pyx_MemviewEnum___init__,
24209 #
if PY_VERSION_HEX >= 0x030400a1
24212 #
if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
24215 #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
24218 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
24222 static struct __pyx_vtabstruct_memoryview __pyx_vtable_memoryview;
24224 static PyObject *__pyx_tp_new_memoryview(PyTypeObject *t, PyObject *a, PyObject *k) {
24225 struct __pyx_memoryview_obj *p;
24227 if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
24228 o = (*t->tp_alloc)(t, 0);
24230 o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
24232 if (unlikely(!o))
return 0;
24233 p = ((
struct __pyx_memoryview_obj *)o);
24234 p->__pyx_vtab = __pyx_vtabptr_memoryview;
24235 p->obj = Py_None; Py_INCREF(Py_None);
24236 p->_size = Py_None; Py_INCREF(Py_None);
24237 p->_array_interface = Py_None; Py_INCREF(Py_None);
24238 p->view.obj = NULL;
24239 if (unlikely(__pyx_memoryview___cinit__(o, a, k) < 0))
goto bad;
24242 Py_DECREF(o); o = 0;
24246 static void __pyx_tp_dealloc_memoryview(PyObject *o) {
24247 struct __pyx_memoryview_obj *p = (
struct __pyx_memoryview_obj *)o;
24248 #if CYTHON_USE_TP_FINALIZE
24249 if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !__Pyx_PyObject_GC_IsFinalized(o)) {
24250 if (PyObject_CallFinalizerFromDealloc(o))
return;
24253 PyObject_GC_UnTrack(o);
24255 PyObject *etype, *eval, *etb;
24256 PyErr_Fetch(&etype, &eval, &etb);
24257 __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1);
24258 __pyx_memoryview___dealloc__(o);
24259 __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1);
24260 PyErr_Restore(etype, eval, etb);
24263 Py_CLEAR(p->_size);
24264 Py_CLEAR(p->_array_interface);
24265 (*Py_TYPE(o)->tp_free)(o);
24268 static int __pyx_tp_traverse_memoryview(PyObject *o, visitproc v,
void *a) {
24270 struct __pyx_memoryview_obj *p = (
struct __pyx_memoryview_obj *)o;
24272 e = (*v)(p->obj, a);
if (e)
return e;
24275 e = (*v)(p->_size, a);
if (e)
return e;
24277 if (p->_array_interface) {
24278 e = (*v)(p->_array_interface, a);
if (e)
return e;
24281 e = (*v)(p->view.obj, a);
if (e)
return e;
24286 static int __pyx_tp_clear_memoryview(PyObject *o) {
24288 struct __pyx_memoryview_obj *p = (
struct __pyx_memoryview_obj *)o;
24289 tmp = ((PyObject*)p->obj);
24290 p->obj = Py_None; Py_INCREF(Py_None);
24292 tmp = ((PyObject*)p->_size);
24293 p->_size = Py_None; Py_INCREF(Py_None);
24295 tmp = ((PyObject*)p->_array_interface);
24296 p->_array_interface = Py_None; Py_INCREF(Py_None);
24298 Py_CLEAR(p->view.obj);
24301 static PyObject *__pyx_sq_item_memoryview(PyObject *o, Py_ssize_t i) {
24303 PyObject *x = PyInt_FromSsize_t(i);
if(!x)
return 0;
24304 r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
24309 static int __pyx_mp_ass_subscript_memoryview(PyObject *o, PyObject *i, PyObject *v) {
24311 return __pyx_memoryview___setitem__(o, i, v);
24314 PyErr_Format(PyExc_NotImplementedError,
24315 "Subscript deletion not supported by %.200s", Py_TYPE(o)->tp_name);
24320 static PyObject *__pyx_getprop___pyx_memoryview_T(PyObject *o, CYTHON_UNUSED
void *x) {
24321 return __pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(o);
24324 static PyObject *__pyx_getprop___pyx_memoryview_base(PyObject *o, CYTHON_UNUSED
void *x) {
24325 return __pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(o);
24328 static PyObject *__pyx_getprop___pyx_memoryview_shape(PyObject *o, CYTHON_UNUSED
void *x) {
24329 return __pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(o);
24332 static PyObject *__pyx_getprop___pyx_memoryview_strides(PyObject *o, CYTHON_UNUSED
void *x) {
24333 return __pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(o);
24336 static PyObject *__pyx_getprop___pyx_memoryview_suboffsets(PyObject *o, CYTHON_UNUSED
void *x) {
24337 return __pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(o);
24340 static PyObject *__pyx_getprop___pyx_memoryview_ndim(PyObject *o, CYTHON_UNUSED
void *x) {
24341 return __pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(o);
24344 static PyObject *__pyx_getprop___pyx_memoryview_itemsize(PyObject *o, CYTHON_UNUSED
void *x) {
24345 return __pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(o);
24348 static PyObject *__pyx_getprop___pyx_memoryview_nbytes(PyObject *o, CYTHON_UNUSED
void *x) {
24349 return __pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(o);
24352 static PyObject *__pyx_getprop___pyx_memoryview_size(PyObject *o, CYTHON_UNUSED
void *x) {
24353 return __pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(o);
24356 static PyMethodDef __pyx_methods_memoryview[] = {
24357 {
"is_c_contig", (PyCFunction)__pyx_memoryview_is_c_contig, METH_NOARGS, 0},
24358 {
"is_f_contig", (PyCFunction)__pyx_memoryview_is_f_contig, METH_NOARGS, 0},
24359 {
"copy", (PyCFunction)__pyx_memoryview_copy, METH_NOARGS, 0},
24360 {
"copy_fortran", (PyCFunction)__pyx_memoryview_copy_fortran, METH_NOARGS, 0},
24361 {
"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_memoryview_1__reduce_cython__, METH_NOARGS, 0},
24362 {
"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_memoryview_3__setstate_cython__, METH_O, 0},
24366 static struct PyGetSetDef __pyx_getsets_memoryview[] = {
24367 {(
char *)
"T", __pyx_getprop___pyx_memoryview_T, 0, (
char *)0, 0},
24368 {(
char *)
"base", __pyx_getprop___pyx_memoryview_base, 0, (
char *)0, 0},
24369 {(
char *)
"shape", __pyx_getprop___pyx_memoryview_shape, 0, (
char *)0, 0},
24370 {(
char *)
"strides", __pyx_getprop___pyx_memoryview_strides, 0, (
char *)0, 0},
24371 {(
char *)
"suboffsets", __pyx_getprop___pyx_memoryview_suboffsets, 0, (
char *)0, 0},
24372 {(
char *)
"ndim", __pyx_getprop___pyx_memoryview_ndim, 0, (
char *)0, 0},
24373 {(
char *)
"itemsize", __pyx_getprop___pyx_memoryview_itemsize, 0, (
char *)0, 0},
24374 {(
char *)
"nbytes", __pyx_getprop___pyx_memoryview_nbytes, 0, (
char *)0, 0},
24375 {(
char *)
"size", __pyx_getprop___pyx_memoryview_size, 0, (
char *)0, 0},
24379 static PySequenceMethods __pyx_tp_as_sequence_memoryview = {
24380 __pyx_memoryview___len__,
24383 __pyx_sq_item_memoryview,
24392 static PyMappingMethods __pyx_tp_as_mapping_memoryview = {
24393 __pyx_memoryview___len__,
24394 __pyx_memoryview___getitem__,
24395 __pyx_mp_ass_subscript_memoryview,
24398 static PyBufferProcs __pyx_tp_as_buffer_memoryview = {
24399 #if PY_MAJOR_VERSION < 3
24402 #if PY_MAJOR_VERSION < 3
24405 #if PY_MAJOR_VERSION < 3
24408 #if PY_MAJOR_VERSION < 3
24411 __pyx_memoryview_getbuffer,
24415 static PyTypeObject __pyx_type___pyx_memoryview = {
24416 PyVarObject_HEAD_INIT(0, 0)
24417 "imate.traceinv._hutchinson_method.memoryview",
24418 sizeof(
struct __pyx_memoryview_obj),
24420 __pyx_tp_dealloc_memoryview,
24421 #
if PY_VERSION_HEX < 0x030800b4
24424 #
if PY_VERSION_HEX >= 0x030800b4
24429 #
if PY_MAJOR_VERSION < 3
24432 #
if PY_MAJOR_VERSION >= 3
24435 __pyx_memoryview___repr__,
24437 &__pyx_tp_as_sequence_memoryview,
24438 &__pyx_tp_as_mapping_memoryview,
24441 __pyx_memoryview___str__,
24444 &__pyx_tp_as_buffer_memoryview,
24445 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC,
24447 __pyx_tp_traverse_memoryview,
24448 __pyx_tp_clear_memoryview,
24453 __pyx_methods_memoryview,
24455 __pyx_getsets_memoryview,
24463 __pyx_tp_new_memoryview,
24473 #
if PY_VERSION_HEX >= 0x030400a1
24476 #
if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
24479 #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
24482 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
24486 static struct __pyx_vtabstruct__memoryviewslice __pyx_vtable__memoryviewslice;
24488 static PyObject *__pyx_tp_new__memoryviewslice(PyTypeObject *t, PyObject *a, PyObject *k) {
24489 struct __pyx_memoryviewslice_obj *p;
24490 PyObject *o = __pyx_tp_new_memoryview(t, a, k);
24491 if (unlikely(!o))
return 0;
24492 p = ((
struct __pyx_memoryviewslice_obj *)o);
24493 p->__pyx_base.__pyx_vtab = (
struct __pyx_vtabstruct_memoryview*)__pyx_vtabptr__memoryviewslice;
24494 p->from_object = Py_None; Py_INCREF(Py_None);
24495 p->from_slice.memview = NULL;
24499 static void __pyx_tp_dealloc__memoryviewslice(PyObject *o) {
24500 struct __pyx_memoryviewslice_obj *p = (
struct __pyx_memoryviewslice_obj *)o;
24501 #if CYTHON_USE_TP_FINALIZE
24502 if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !__Pyx_PyObject_GC_IsFinalized(o)) {
24503 if (PyObject_CallFinalizerFromDealloc(o))
return;
24506 PyObject_GC_UnTrack(o);
24508 PyObject *etype, *eval, *etb;
24509 PyErr_Fetch(&etype, &eval, &etb);
24510 __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1);
24511 __pyx_memoryviewslice___dealloc__(o);
24512 __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1);
24513 PyErr_Restore(etype, eval, etb);
24515 Py_CLEAR(p->from_object);
24516 PyObject_GC_Track(o);
24517 __pyx_tp_dealloc_memoryview(o);
24520 static int __pyx_tp_traverse__memoryviewslice(PyObject *o, visitproc v,
void *a) {
24522 struct __pyx_memoryviewslice_obj *p = (
struct __pyx_memoryviewslice_obj *)o;
24523 e = __pyx_tp_traverse_memoryview(o, v, a);
if (e)
return e;
24524 if (p->from_object) {
24525 e = (*v)(p->from_object, a);
if (e)
return e;
24530 static int __pyx_tp_clear__memoryviewslice(PyObject *o) {
24532 struct __pyx_memoryviewslice_obj *p = (
struct __pyx_memoryviewslice_obj *)o;
24533 __pyx_tp_clear_memoryview(o);
24534 tmp = ((PyObject*)p->from_object);
24535 p->from_object = Py_None; Py_INCREF(Py_None);
24537 __PYX_XDEC_MEMVIEW(&p->from_slice, 1);
24541 static PyObject *__pyx_getprop___pyx_memoryviewslice_base(PyObject *o, CYTHON_UNUSED
void *x) {
24542 return __pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(o);
24545 static PyMethodDef __pyx_methods__memoryviewslice[] = {
24546 {
"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_memoryviewslice_1__reduce_cython__, METH_NOARGS, 0},
24547 {
"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_memoryviewslice_3__setstate_cython__, METH_O, 0},
24551 static struct PyGetSetDef __pyx_getsets__memoryviewslice[] = {
24552 {(
char *)
"base", __pyx_getprop___pyx_memoryviewslice_base, 0, (
char *)0, 0},
24556 static PyTypeObject __pyx_type___pyx_memoryviewslice = {
24557 PyVarObject_HEAD_INIT(0, 0)
24558 "imate.traceinv._hutchinson_method._memoryviewslice",
24559 sizeof(
struct __pyx_memoryviewslice_obj),
24561 __pyx_tp_dealloc__memoryviewslice,
24562 #
if PY_VERSION_HEX < 0x030800b4
24565 #
if PY_VERSION_HEX >= 0x030800b4
24570 #
if PY_MAJOR_VERSION < 3
24573 #
if PY_MAJOR_VERSION >= 3
24576 #
if CYTHON_COMPILING_IN_PYPY
24577 __pyx_memoryview___repr__,
24586 #
if CYTHON_COMPILING_IN_PYPY
24587 __pyx_memoryview___str__,
24594 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC,
24595 "Internal class for passing memoryview slices to Python",
24596 __pyx_tp_traverse__memoryviewslice,
24597 __pyx_tp_clear__memoryviewslice,
24602 __pyx_methods__memoryviewslice,
24604 __pyx_getsets__memoryviewslice,
24612 __pyx_tp_new__memoryviewslice,
24622 #
if PY_VERSION_HEX >= 0x030400a1
24625 #
if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
24628 #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
24631 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
24636 static PyMethodDef __pyx_methods[] = {
24640 #if PY_MAJOR_VERSION >= 3
24641 #if CYTHON_PEP489_MULTI_PHASE_INIT
24642 static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def);
24643 static int __pyx_pymod_exec__hutchinson_method(PyObject* module);
24644 static PyModuleDef_Slot __pyx_moduledef_slots[] = {
24645 {Py_mod_create, (
void*)__pyx_pymod_create},
24646 {Py_mod_exec, (
void*)__pyx_pymod_exec__hutchinson_method},
24651 static struct PyModuleDef __pyx_moduledef = {
24652 PyModuleDef_HEAD_INIT,
24653 "_hutchinson_method",
24655 #if CYTHON_PEP489_MULTI_PHASE_INIT
24661 #if CYTHON_PEP489_MULTI_PHASE_INIT
24662 __pyx_moduledef_slots,
24671 #ifndef CYTHON_SMALL_CODE
24672 #if defined(__clang__)
24673 #define CYTHON_SMALL_CODE
24674 #elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))
24675 #define CYTHON_SMALL_CODE __attribute__((cold))
24677 #define CYTHON_SMALL_CODE
24681 static __Pyx_StringTabEntry __pyx_string_tab[] = {
24682 {&__pyx_n_s_A, __pyx_k_A,
sizeof(__pyx_k_A), 0, 0, 1, 1},
24683 {&__pyx_n_s_ASCII, __pyx_k_ASCII,
sizeof(__pyx_k_ASCII), 0, 0, 1, 1},
24684 {&__pyx_n_s_AinvpE, __pyx_k_AinvpE,
sizeof(__pyx_k_AinvpE), 0, 0, 1, 1},
24685 {&__pyx_n_s_AtA, __pyx_k_AtA,
sizeof(__pyx_k_AtA), 0, 0, 1, 1},
24686 {&__pyx_kp_u_AtA_cannot_be_None, __pyx_k_AtA_cannot_be_None,
sizeof(__pyx_k_AtA_cannot_be_None), 0, 1, 0, 0},
24687 {&__pyx_n_s_B, __pyx_k_B,
sizeof(__pyx_k_B), 0, 0, 1, 1},
24688 {&__pyx_n_s_BE, __pyx_k_BE,
sizeof(__pyx_k_BE), 0, 0, 1, 1},
24689 {&__pyx_kp_s_Buffer_view_does_not_expose_stri, __pyx_k_Buffer_view_does_not_expose_stri,
sizeof(__pyx_k_Buffer_view_does_not_expose_stri), 0, 0, 1, 0},
24690 {&__pyx_n_s_C, __pyx_k_C,
sizeof(__pyx_k_C), 0, 0, 1, 1},
24691 {&__pyx_kp_s_Can_only_create_a_buffer_that_is, __pyx_k_Can_only_create_a_buffer_that_is,
sizeof(__pyx_k_Can_only_create_a_buffer_that_is), 0, 0, 1, 0},
24692 {&__pyx_kp_s_Cannot_assign_to_read_only_memor, __pyx_k_Cannot_assign_to_read_only_memor,
sizeof(__pyx_k_Cannot_assign_to_read_only_memor), 0, 0, 1, 0},
24693 {&__pyx_kp_s_Cannot_create_writable_memory_vi, __pyx_k_Cannot_create_writable_memory_vi,
sizeof(__pyx_k_Cannot_create_writable_memory_vi), 0, 0, 1, 0},
24694 {&__pyx_kp_s_Cannot_index_with_type_s, __pyx_k_Cannot_index_with_type_s,
sizeof(__pyx_k_Cannot_index_with_type_s), 0, 0, 1, 0},
24695 {&__pyx_kp_u_Data_type_should_be_either_float, __pyx_k_Data_type_should_be_either_float,
sizeof(__pyx_k_Data_type_should_be_either_float), 0, 1, 0, 0},
24696 {&__pyx_n_s_E, __pyx_k_E,
sizeof(__pyx_k_E), 0, 0, 1, 1},
24697 {&__pyx_n_s_Ellipsis, __pyx_k_Ellipsis,
sizeof(__pyx_k_Ellipsis), 0, 0, 1, 1},
24698 {&__pyx_kp_s_Empty_shape_tuple_for_cython_arr, __pyx_k_Empty_shape_tuple_for_cython_arr,
sizeof(__pyx_k_Empty_shape_tuple_for_cython_arr), 0, 0, 1, 0},
24699 {&__pyx_n_u_F, __pyx_k_F,
sizeof(__pyx_k_F), 0, 1, 0, 1},
24700 {&__pyx_kp_s_Incompatible_checksums_0x_x_vs_0, __pyx_k_Incompatible_checksums_0x_x_vs_0,
sizeof(__pyx_k_Incompatible_checksums_0x_x_vs_0), 0, 0, 1, 0},
24701 {&__pyx_n_s_IndexError, __pyx_k_IndexError,
sizeof(__pyx_k_IndexError), 0, 0, 1, 1},
24702 {&__pyx_kp_s_Indirect_dimensions_not_supporte, __pyx_k_Indirect_dimensions_not_supporte,
sizeof(__pyx_k_Indirect_dimensions_not_supporte), 0, 0, 1, 0},
24703 {&__pyx_kp_s_Invalid_mode_expected_c_or_fortr, __pyx_k_Invalid_mode_expected_c_or_fortr,
sizeof(__pyx_k_Invalid_mode_expected_c_or_fortr), 0, 0, 1, 0},
24704 {&__pyx_kp_s_Invalid_shape_in_axis_d_d, __pyx_k_Invalid_shape_in_axis_d_d,
sizeof(__pyx_k_Invalid_shape_in_axis_d_d), 0, 0, 1, 0},
24705 {&__pyx_n_s_MemoryError, __pyx_k_MemoryError,
sizeof(__pyx_k_MemoryError), 0, 0, 1, 1},
24706 {&__pyx_kp_s_MemoryView_of_r_at_0x_x, __pyx_k_MemoryView_of_r_at_0x_x,
sizeof(__pyx_k_MemoryView_of_r_at_0x_x), 0, 0, 1, 0},
24707 {&__pyx_kp_s_MemoryView_of_r_object, __pyx_k_MemoryView_of_r_object,
sizeof(__pyx_k_MemoryView_of_r_object), 0, 0, 1, 0},
24708 {&__pyx_n_b_O, __pyx_k_O,
sizeof(__pyx_k_O), 0, 0, 0, 1},
24709 {&__pyx_n_s_OpE, __pyx_k_OpE,
sizeof(__pyx_k_OpE), 0, 0, 1, 1},
24710 {&__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_k_Out_of_bounds_on_buffer_access_a,
sizeof(__pyx_k_Out_of_bounds_on_buffer_access_a), 0, 0, 1, 0},
24711 {&__pyx_n_s_PickleError, __pyx_k_PickleError,
sizeof(__pyx_k_PickleError), 0, 0, 1, 1},
24712 {&__pyx_n_s_RuntimeError, __pyx_k_RuntimeError,
sizeof(__pyx_k_RuntimeError), 0, 0, 1, 1},
24713 {&__pyx_n_s_T, __pyx_k_T,
sizeof(__pyx_k_T), 0, 0, 1, 1},
24714 {&__pyx_kp_u_Trace_of_matrix_or_linear_opera, __pyx_k_Trace_of_matrix_or_linear_opera,
sizeof(__pyx_k_Trace_of_matrix_or_linear_opera), 0, 1, 0, 0},
24715 {&__pyx_n_s_TypeError, __pyx_k_TypeError,
sizeof(__pyx_k_TypeError), 0, 0, 1, 1},
24716 {&__pyx_kp_s_Unable_to_convert_item_to_object, __pyx_k_Unable_to_convert_item_to_object,
sizeof(__pyx_k_Unable_to_convert_item_to_object), 0, 0, 1, 0},
24717 {&__pyx_n_s_ValueError, __pyx_k_ValueError,
sizeof(__pyx_k_ValueError), 0, 0, 1, 1},
24718 {&__pyx_n_s_View_MemoryView, __pyx_k_View_MemoryView,
sizeof(__pyx_k_View_MemoryView), 0, 0, 1, 1},
24719 {&__pyx_n_s_abs, __pyx_k_abs,
sizeof(__pyx_k_abs), 0, 0, 1, 1},
24720 {&__pyx_n_u_absolute_error, __pyx_k_absolute_error,
sizeof(__pyx_k_absolute_error), 0, 1, 0, 1},
24721 {&__pyx_n_s_alg_wall_time, __pyx_k_alg_wall_time,
sizeof(__pyx_k_alg_wall_time), 0, 0, 1, 1},
24722 {&__pyx_n_u_alg_wall_time, __pyx_k_alg_wall_time,
sizeof(__pyx_k_alg_wall_time), 0, 1, 0, 1},
24723 {&__pyx_n_s_allocate_buffer, __pyx_k_allocate_buffer,
sizeof(__pyx_k_allocate_buffer), 0, 0, 1, 1},
24724 {&__pyx_n_s_assume_matrix, __pyx_k_assume_matrix,
sizeof(__pyx_k_assume_matrix), 0, 0, 1, 1},
24725 {&__pyx_n_u_assume_matrix, __pyx_k_assume_matrix,
sizeof(__pyx_k_assume_matrix), 0, 1, 0, 1},
24726 {&__pyx_n_s_average_estimates, __pyx_k_average_estimates,
sizeof(__pyx_k_average_estimates), 0, 0, 1, 1},
24727 {&__pyx_n_s_base, __pyx_k_base,
sizeof(__pyx_k_base), 0, 0, 1, 1},
24728 {&__pyx_n_s_c, __pyx_k_c,
sizeof(__pyx_k_c), 0, 0, 1, 1},
24729 {&__pyx_n_u_c, __pyx_k_c,
sizeof(__pyx_k_c), 0, 1, 0, 1},
24730 {&__pyx_n_s_cE, __pyx_k_cE,
sizeof(__pyx_k_cE), 0, 0, 1, 1},
24731 {&__pyx_n_s_check_arguments, __pyx_k_check_arguments,
sizeof(__pyx_k_check_arguments), 0, 0, 1, 1},
24732 {&__pyx_n_s_check_convergence, __pyx_k_check_convergence,
sizeof(__pyx_k_check_convergence), 0, 0, 1, 1},
24733 {&__pyx_n_s_class, __pyx_k_class,
sizeof(__pyx_k_class), 0, 0, 1, 1},
24734 {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback,
sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1},
24735 {&__pyx_n_s_confidence_level, __pyx_k_confidence_level,
sizeof(__pyx_k_confidence_level), 0, 0, 1, 1},
24736 {&__pyx_n_u_confidence_level, __pyx_k_confidence_level,
sizeof(__pyx_k_confidence_level), 0, 1, 0, 1},
24737 {&__pyx_kp_s_contiguous_and_direct, __pyx_k_contiguous_and_direct,
sizeof(__pyx_k_contiguous_and_direct), 0, 0, 1, 0},
24738 {&__pyx_kp_s_contiguous_and_indirect, __pyx_k_contiguous_and_indirect,
sizeof(__pyx_k_contiguous_and_indirect), 0, 0, 1, 0},
24739 {&__pyx_n_s_converged, __pyx_k_converged,
sizeof(__pyx_k_converged), 0, 0, 1, 1},
24740 {&__pyx_n_u_converged, __pyx_k_converged,
sizeof(__pyx_k_converged), 0, 1, 0, 1},
24741 {&__pyx_n_u_convergence, __pyx_k_convergence,
sizeof(__pyx_k_convergence), 0, 1, 0, 1},
24742 {&__pyx_n_s_convergence_tools, __pyx_k_convergence_tools,
sizeof(__pyx_k_convergence_tools), 0, 0, 1, 1},
24743 {&__pyx_n_s_cpu_count, __pyx_k_cpu_count,
sizeof(__pyx_k_cpu_count), 0, 0, 1, 1},
24744 {&__pyx_n_s_cpu_proc_time, __pyx_k_cpu_proc_time,
sizeof(__pyx_k_cpu_proc_time), 0, 0, 1, 1},
24745 {&__pyx_n_u_cpu_proc_time, __pyx_k_cpu_proc_time,
sizeof(__pyx_k_cpu_proc_time), 0, 1, 0, 1},
24746 {&__pyx_n_u_data_type, __pyx_k_data_type,
sizeof(__pyx_k_data_type), 0, 1, 0, 1},
24747 {&__pyx_n_s_data_type_name, __pyx_k_data_type_name,
sizeof(__pyx_k_data_type_name), 0, 0, 1, 1},
24748 {&__pyx_n_u_density, __pyx_k_density,
sizeof(__pyx_k_density), 0, 1, 0, 1},
24749 {&__pyx_n_u_device, __pyx_k_device,
sizeof(__pyx_k_device), 0, 1, 0, 1},
24750 {&__pyx_n_s_dict, __pyx_k_dict,
sizeof(__pyx_k_dict), 0, 0, 1, 1},
24751 {&__pyx_n_s_dtype, __pyx_k_dtype,
sizeof(__pyx_k_dtype), 0, 0, 1, 1},
24752 {&__pyx_n_s_dtype_is_object, __pyx_k_dtype_is_object,
sizeof(__pyx_k_dtype_is_object), 0, 0, 1, 1},
24753 {&__pyx_n_s_empty, __pyx_k_empty,
sizeof(__pyx_k_empty), 0, 0, 1, 1},
24754 {&__pyx_n_s_encode, __pyx_k_encode,
sizeof(__pyx_k_encode), 0, 0, 1, 1},
24755 {&__pyx_n_s_enumerate, __pyx_k_enumerate,
sizeof(__pyx_k_enumerate), 0, 0, 1, 1},
24756 {&__pyx_n_s_error, __pyx_k_error,
sizeof(__pyx_k_error), 0, 0, 1, 1},
24757 {&__pyx_n_u_error, __pyx_k_error,
sizeof(__pyx_k_error), 0, 1, 0, 1},
24758 {&__pyx_n_s_error_atol, __pyx_k_error_atol,
sizeof(__pyx_k_error_atol), 0, 0, 1, 1},
24759 {&__pyx_n_u_error_atol, __pyx_k_error_atol,
sizeof(__pyx_k_error_atol), 0, 1, 0, 1},
24760 {&__pyx_n_s_error_rtol, __pyx_k_error_rtol,
sizeof(__pyx_k_error_rtol), 0, 0, 1, 1},
24761 {&__pyx_n_u_error_rtol, __pyx_k_error_rtol,
sizeof(__pyx_k_error_rtol), 0, 1, 0, 1},
24762 {&__pyx_n_u_exponent, __pyx_k_exponent,
sizeof(__pyx_k_exponent), 0, 1, 0, 1},
24763 {&__pyx_n_s_flags, __pyx_k_flags,
sizeof(__pyx_k_flags), 0, 0, 1, 1},
24764 {&__pyx_n_b_float32, __pyx_k_float32,
sizeof(__pyx_k_float32), 0, 0, 0, 1},
24765 {&__pyx_n_s_float32, __pyx_k_float32,
sizeof(__pyx_k_float32), 0, 0, 1, 1},
24766 {&__pyx_n_b_float64, __pyx_k_float64,
sizeof(__pyx_k_float64), 0, 0, 0, 1},
24767 {&__pyx_n_s_float64, __pyx_k_float64,
sizeof(__pyx_k_float64), 0, 0, 1, 1},
24768 {&__pyx_n_s_format, __pyx_k_format,
sizeof(__pyx_k_format), 0, 0, 1, 1},
24769 {&__pyx_n_s_fortran, __pyx_k_fortran,
sizeof(__pyx_k_fortran), 0, 0, 1, 1},
24770 {&__pyx_n_u_fortran, __pyx_k_fortran,
sizeof(__pyx_k_fortran), 0, 1, 0, 1},
24771 {&__pyx_n_u_gen, __pyx_k_gen,
sizeof(__pyx_k_gen), 0, 1, 0, 1},
24772 {&__pyx_n_s_get_data_type_name, __pyx_k_get_data_type_name,
sizeof(__pyx_k_get_data_type_name), 0, 0, 1, 1},
24773 {&__pyx_n_s_get_density, __pyx_k_get_density,
sizeof(__pyx_k_get_density), 0, 0, 1, 1},
24774 {&__pyx_n_s_get_nnz, __pyx_k_get_nnz,
sizeof(__pyx_k_get_nnz), 0, 0, 1, 1},
24775 {&__pyx_n_s_getstate, __pyx_k_getstate,
sizeof(__pyx_k_getstate), 0, 0, 1, 1},
24776 {&__pyx_kp_s_got_differing_extents_in_dimensi, __pyx_k_got_differing_extents_in_dimensi,
sizeof(__pyx_k_got_differing_extents_in_dimensi), 0, 0, 1, 0},
24777 {&__pyx_n_s_gram, __pyx_k_gram,
sizeof(__pyx_k_gram), 0, 0, 1, 1},
24778 {&__pyx_n_u_gram, __pyx_k_gram,
sizeof(__pyx_k_gram), 0, 1, 0, 1},
24779 {&__pyx_n_u_hutchinson, __pyx_k_hutchinson,
sizeof(__pyx_k_hutchinson), 0, 1, 0, 1},
24780 {&__pyx_n_s_hutchinson_method, __pyx_k_hutchinson_method,
sizeof(__pyx_k_hutchinson_method), 0, 0, 1, 1},
24781 {&__pyx_n_s_hutchinson_method_double, __pyx_k_hutchinson_method_double,
sizeof(__pyx_k_hutchinson_method_double), 0, 0, 1, 1},
24782 {&__pyx_n_s_hutchinson_method_float, __pyx_k_hutchinson_method_float,
sizeof(__pyx_k_hutchinson_method_float), 0, 0, 1, 1},
24783 {&__pyx_kp_u_hutchinson_method_line_37, __pyx_k_hutchinson_method_line_37,
sizeof(__pyx_k_hutchinson_method_line_37), 0, 1, 0, 0},
24784 {&__pyx_n_s_hutchinson_method_utilities, __pyx_k_hutchinson_method_utilities,
sizeof(__pyx_k_hutchinson_method_utilities), 0, 0, 1, 1},
24785 {&__pyx_n_s_i, __pyx_k_i,
sizeof(__pyx_k_i), 0, 0, 1, 1},
24786 {&__pyx_n_s_id, __pyx_k_id,
sizeof(__pyx_k_id), 0, 0, 1, 1},
24787 {&__pyx_kp_s_imate_traceinv__hutchinson_metho, __pyx_k_imate_traceinv__hutchinson_metho,
sizeof(__pyx_k_imate_traceinv__hutchinson_metho), 0, 0, 1, 0},
24788 {&__pyx_n_s_imate_traceinv__hutchinson_metho_2, __pyx_k_imate_traceinv__hutchinson_metho_2,
sizeof(__pyx_k_imate_traceinv__hutchinson_metho_2), 0, 0, 1, 1},
24789 {&__pyx_n_s_imatmul, __pyx_k_imatmul,
sizeof(__pyx_k_imatmul), 0, 0, 1, 1},
24790 {&__pyx_n_s_import, __pyx_k_import,
sizeof(__pyx_k_import), 0, 0, 1, 1},
24791 {&__pyx_n_s_info, __pyx_k_info,
sizeof(__pyx_k_info), 0, 0, 1, 1},
24792 {&__pyx_n_s_init_alg_wall_time, __pyx_k_init_alg_wall_time,
sizeof(__pyx_k_init_alg_wall_time), 0, 0, 1, 1},
24793 {&__pyx_n_s_init_cpu_proc_time, __pyx_k_init_cpu_proc_time,
sizeof(__pyx_k_init_cpu_proc_time), 0, 0, 1, 1},
24794 {&__pyx_n_s_init_tot_wall_time, __pyx_k_init_tot_wall_time,
sizeof(__pyx_k_init_tot_wall_time), 0, 0, 1, 1},
24795 {&__pyx_n_s_isspmatrix, __pyx_k_isspmatrix,
sizeof(__pyx_k_isspmatrix), 0, 0, 1, 1},
24796 {&__pyx_n_s_itemsize, __pyx_k_itemsize,
sizeof(__pyx_k_itemsize), 0, 0, 1, 1},
24797 {&__pyx_kp_s_itemsize_0_for_cython_array, __pyx_k_itemsize_0_for_cython_array,
sizeof(__pyx_k_itemsize_0_for_cython_array), 0, 0, 1, 0},
24798 {&__pyx_n_s_linear_algebra, __pyx_k_linear_algebra,
sizeof(__pyx_k_linear_algebra), 0, 0, 1, 1},
24799 {&__pyx_n_s_linear_algebra_matrix_utilities, __pyx_k_linear_algebra_matrix_utilities,
sizeof(__pyx_k_linear_algebra_matrix_utilities), 0, 0, 1, 1},
24800 {&__pyx_n_s_linear_solver, __pyx_k_linear_solver,
sizeof(__pyx_k_linear_solver), 0, 0, 1, 1},
24801 {&__pyx_n_s_main, __pyx_k_main,
sizeof(__pyx_k_main), 0, 0, 1, 1},
24802 {&__pyx_n_s_matmul, __pyx_k_matmul,
sizeof(__pyx_k_matmul), 0, 0, 1, 1},
24803 {&__pyx_n_u_matrix, __pyx_k_matrix,
sizeof(__pyx_k_matrix), 0, 1, 0, 1},
24804 {&__pyx_n_s_max_num_samples, __pyx_k_max_num_samples,
sizeof(__pyx_k_max_num_samples), 0, 0, 1, 1},
24805 {&__pyx_n_u_max_num_samples, __pyx_k_max_num_samples,
sizeof(__pyx_k_max_num_samples), 0, 1, 0, 1},
24806 {&__pyx_n_s_memoryview_E, __pyx_k_memoryview_E,
sizeof(__pyx_k_memoryview_E), 0, 0, 1, 1},
24807 {&__pyx_n_s_memview, __pyx_k_memview,
sizeof(__pyx_k_memview), 0, 0, 1, 1},
24808 {&__pyx_n_u_method, __pyx_k_method,
sizeof(__pyx_k_method), 0, 1, 0, 1},
24809 {&__pyx_n_s_min_num_samples, __pyx_k_min_num_samples,
sizeof(__pyx_k_min_num_samples), 0, 0, 1, 1},
24810 {&__pyx_n_u_min_num_samples, __pyx_k_min_num_samples,
sizeof(__pyx_k_min_num_samples), 0, 1, 0, 1},
24811 {&__pyx_n_s_mode, __pyx_k_mode,
sizeof(__pyx_k_mode), 0, 0, 1, 1},
24812 {&__pyx_n_s_multiprocessing, __pyx_k_multiprocessing,
sizeof(__pyx_k_multiprocessing), 0, 0, 1, 1},
24813 {&__pyx_n_s_name, __pyx_k_name,
sizeof(__pyx_k_name), 0, 0, 1, 1},
24814 {&__pyx_n_s_name_2, __pyx_k_name_2,
sizeof(__pyx_k_name_2), 0, 0, 1, 1},
24815 {&__pyx_n_s_nan, __pyx_k_nan,
sizeof(__pyx_k_nan), 0, 0, 1, 1},
24816 {&__pyx_n_s_ndim, __pyx_k_ndim,
sizeof(__pyx_k_ndim), 0, 0, 1, 1},
24817 {&__pyx_n_s_new, __pyx_k_new,
sizeof(__pyx_k_new), 0, 0, 1, 1},
24818 {&__pyx_n_u_nnz, __pyx_k_nnz,
sizeof(__pyx_k_nnz), 0, 1, 0, 1},
24819 {&__pyx_kp_s_no_default___reduce___due_to_non, __pyx_k_no_default___reduce___due_to_non,
sizeof(__pyx_k_no_default___reduce___due_to_non), 0, 0, 1, 0},
24820 {&__pyx_n_u_num_cpu_threads, __pyx_k_num_cpu_threads,
sizeof(__pyx_k_num_cpu_threads), 0, 1, 0, 1},
24821 {&__pyx_n_u_num_gpu_devices, __pyx_k_num_gpu_devices,
sizeof(__pyx_k_num_gpu_devices), 0, 1, 0, 1},
24822 {&__pyx_n_u_num_gpu_multiprocessors, __pyx_k_num_gpu_multiprocessors,
sizeof(__pyx_k_num_gpu_multiprocessors), 0, 1, 0, 1},
24823 {&__pyx_n_u_num_gpu_threads_per_multiprocess, __pyx_k_num_gpu_threads_per_multiprocess,
sizeof(__pyx_k_num_gpu_threads_per_multiprocess), 0, 1, 0, 1},
24824 {&__pyx_n_u_num_inquiries, __pyx_k_num_inquiries,
sizeof(__pyx_k_num_inquiries), 0, 1, 0, 1},
24825 {&__pyx_n_s_num_outliers, __pyx_k_num_outliers,
sizeof(__pyx_k_num_outliers), 0, 0, 1, 1},
24826 {&__pyx_n_u_num_outliers, __pyx_k_num_outliers,
sizeof(__pyx_k_num_outliers), 0, 1, 0, 1},
24827 {&__pyx_n_s_num_processed_samples, __pyx_k_num_processed_samples,
sizeof(__pyx_k_num_processed_samples), 0, 0, 1, 1},
24828 {&__pyx_n_s_num_samples_used, __pyx_k_num_samples_used,
sizeof(__pyx_k_num_samples_used), 0, 0, 1, 1},
24829 {&__pyx_n_u_num_samples_used, __pyx_k_num_samples_used,
sizeof(__pyx_k_num_samples_used), 0, 1, 0, 1},
24830 {&__pyx_n_s_num_threads, __pyx_k_num_threads,
sizeof(__pyx_k_num_threads), 0, 0, 1, 1},
24831 {&__pyx_n_s_numpy, __pyx_k_numpy,
sizeof(__pyx_k_numpy), 0, 0, 1, 1},
24832 {&__pyx_n_s_obj, __pyx_k_obj,
sizeof(__pyx_k_obj), 0, 0, 1, 1},
24833 {&__pyx_n_s_operator_dot, __pyx_k_operator_dot,
sizeof(__pyx_k_operator_dot), 0, 0, 1, 1},
24834 {&__pyx_n_s_order, __pyx_k_order,
sizeof(__pyx_k_order), 0, 0, 1, 1},
24835 {&__pyx_n_s_orthogonalize, __pyx_k_orthogonalize,
sizeof(__pyx_k_orthogonalize), 0, 0, 1, 1},
24836 {&__pyx_n_u_orthogonalize, __pyx_k_orthogonalize,
sizeof(__pyx_k_orthogonalize), 0, 1, 0, 1},
24837 {&__pyx_n_s_outlier_significance_level, __pyx_k_outlier_significance_level,
sizeof(__pyx_k_outlier_significance_level), 0, 0, 1, 1},
24838 {&__pyx_n_u_outlier_significance_level, __pyx_k_outlier_significance_level,
sizeof(__pyx_k_outlier_significance_level), 0, 1, 0, 1},
24839 {&__pyx_n_s_p, __pyx_k_p,
sizeof(__pyx_k_p), 0, 0, 1, 1},
24840 {&__pyx_n_s_pack, __pyx_k_pack,
sizeof(__pyx_k_pack), 0, 0, 1, 1},
24841 {&__pyx_n_s_perf_counter, __pyx_k_perf_counter,
sizeof(__pyx_k_perf_counter), 0, 0, 1, 1},
24842 {&__pyx_n_s_pickle, __pyx_k_pickle,
sizeof(__pyx_k_pickle), 0, 0, 1, 1},
24843 {&__pyx_n_s_plot, __pyx_k_plot,
sizeof(__pyx_k_plot), 0, 0, 1, 1},
24844 {&__pyx_n_s_plot_convergence, __pyx_k_plot_convergence,
sizeof(__pyx_k_plot_convergence), 0, 0, 1, 1},
24845 {&__pyx_n_s_print_summary, __pyx_k_print_summary,
sizeof(__pyx_k_print_summary), 0, 0, 1, 1},
24846 {&__pyx_n_s_process_time, __pyx_k_process_time,
sizeof(__pyx_k_process_time), 0, 0, 1, 1},
24847 {&__pyx_n_s_processed_samples_indices, __pyx_k_processed_samples_indices,
sizeof(__pyx_k_processed_samples_indices), 0, 0, 1, 1},
24848 {&__pyx_n_s_pyx_PickleError, __pyx_k_pyx_PickleError,
sizeof(__pyx_k_pyx_PickleError), 0, 0, 1, 1},
24849 {&__pyx_n_s_pyx_checksum, __pyx_k_pyx_checksum,
sizeof(__pyx_k_pyx_checksum), 0, 0, 1, 1},
24850 {&__pyx_n_s_pyx_getbuffer, __pyx_k_pyx_getbuffer,
sizeof(__pyx_k_pyx_getbuffer), 0, 0, 1, 1},
24851 {&__pyx_n_s_pyx_result, __pyx_k_pyx_result,
sizeof(__pyx_k_pyx_result), 0, 0, 1, 1},
24852 {&__pyx_n_s_pyx_state, __pyx_k_pyx_state,
sizeof(__pyx_k_pyx_state), 0, 0, 1, 1},
24853 {&__pyx_n_s_pyx_type, __pyx_k_pyx_type,
sizeof(__pyx_k_pyx_type), 0, 0, 1, 1},
24854 {&__pyx_n_s_pyx_unpickle_Enum, __pyx_k_pyx_unpickle_Enum,
sizeof(__pyx_k_pyx_unpickle_Enum), 0, 0, 1, 1},
24855 {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable,
sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1},
24856 {&__pyx_n_s_range, __pyx_k_range,
sizeof(__pyx_k_range), 0, 0, 1, 1},
24857 {&__pyx_n_s_reduce, __pyx_k_reduce,
sizeof(__pyx_k_reduce), 0, 0, 1, 1},
24858 {&__pyx_n_s_reduce_cython, __pyx_k_reduce_cython,
sizeof(__pyx_k_reduce_cython), 0, 0, 1, 1},
24859 {&__pyx_n_s_reduce_ex, __pyx_k_reduce_ex,
sizeof(__pyx_k_reduce_ex), 0, 0, 1, 1},
24860 {&__pyx_n_u_relative_error, __pyx_k_relative_error,
sizeof(__pyx_k_relative_error), 0, 1, 0, 1},
24861 {&__pyx_n_s_return_info, __pyx_k_return_info,
sizeof(__pyx_k_return_info), 0, 0, 1, 1},
24862 {&__pyx_n_s_rmatmul, __pyx_k_rmatmul,
sizeof(__pyx_k_rmatmul), 0, 0, 1, 1},
24863 {&__pyx_n_s_samples, __pyx_k_samples,
sizeof(__pyx_k_samples), 0, 0, 1, 1},
24864 {&__pyx_n_u_samples, __pyx_k_samples,
sizeof(__pyx_k_samples), 0, 1, 0, 1},
24865 {&__pyx_n_u_samples_mean, __pyx_k_samples_mean,
sizeof(__pyx_k_samples_mean), 0, 1, 0, 1},
24866 {&__pyx_n_u_samples_processed_order, __pyx_k_samples_processed_order,
sizeof(__pyx_k_samples_processed_order), 0, 1, 0, 1},
24867 {&__pyx_n_s_scipy, __pyx_k_scipy,
sizeof(__pyx_k_scipy), 0, 0, 1, 1},
24868 {&__pyx_n_s_scipy_sparse, __pyx_k_scipy_sparse,
sizeof(__pyx_k_scipy_sparse), 0, 0, 1, 1},
24869 {&__pyx_n_s_setstate, __pyx_k_setstate,
sizeof(__pyx_k_setstate), 0, 0, 1, 1},
24870 {&__pyx_n_s_setstate_cython, __pyx_k_setstate_cython,
sizeof(__pyx_k_setstate_cython), 0, 0, 1, 1},
24871 {&__pyx_n_s_shape, __pyx_k_shape,
sizeof(__pyx_k_shape), 0, 0, 1, 1},
24872 {&__pyx_n_s_size, __pyx_k_size,
sizeof(__pyx_k_size), 0, 0, 1, 1},
24873 {&__pyx_n_u_size, __pyx_k_size,
sizeof(__pyx_k_size), 0, 1, 0, 1},
24874 {&__pyx_n_u_solver, __pyx_k_solver,
sizeof(__pyx_k_solver), 0, 1, 0, 1},
24875 {&__pyx_n_s_solver_tol, __pyx_k_solver_tol,
sizeof(__pyx_k_solver_tol), 0, 0, 1, 1},
24876 {&__pyx_n_u_solver_tol, __pyx_k_solver_tol,
sizeof(__pyx_k_solver_tol), 0, 1, 0, 1},
24877 {&__pyx_n_u_sparse, __pyx_k_sparse,
sizeof(__pyx_k_sparse), 0, 1, 0, 1},
24878 {&__pyx_n_s_square, __pyx_k_square,
sizeof(__pyx_k_square), 0, 0, 1, 1},
24879 {&__pyx_n_s_start, __pyx_k_start,
sizeof(__pyx_k_start), 0, 0, 1, 1},
24880 {&__pyx_n_s_step, __pyx_k_step,
sizeof(__pyx_k_step), 0, 0, 1, 1},
24881 {&__pyx_n_s_stop, __pyx_k_stop,
sizeof(__pyx_k_stop), 0, 0, 1, 1},
24882 {&__pyx_kp_s_strided_and_direct, __pyx_k_strided_and_direct,
sizeof(__pyx_k_strided_and_direct), 0, 0, 1, 0},
24883 {&__pyx_kp_s_strided_and_direct_or_indirect, __pyx_k_strided_and_direct_or_indirect,
sizeof(__pyx_k_strided_and_direct_or_indirect), 0, 0, 1, 0},
24884 {&__pyx_kp_s_strided_and_indirect, __pyx_k_strided_and_indirect,
sizeof(__pyx_k_strided_and_indirect), 0, 0, 1, 0},
24885 {&__pyx_kp_s_stringsource, __pyx_k_stringsource,
sizeof(__pyx_k_stringsource), 0, 0, 1, 0},
24886 {&__pyx_n_s_struct, __pyx_k_struct,
sizeof(__pyx_k_struct), 0, 0, 1, 1},
24887 {&__pyx_n_s_test, __pyx_k_test,
sizeof(__pyx_k_test), 0, 0, 1, 1},
24888 {&__pyx_n_s_time, __pyx_k_time,
sizeof(__pyx_k_time), 0, 0, 1, 1},
24889 {&__pyx_n_u_time, __pyx_k_time,
sizeof(__pyx_k_time), 0, 1, 0, 1},
24890 {&__pyx_n_s_tot_wall_time, __pyx_k_tot_wall_time,
sizeof(__pyx_k_tot_wall_time), 0, 0, 1, 1},
24891 {&__pyx_n_u_tot_wall_time, __pyx_k_tot_wall_time,
sizeof(__pyx_k_tot_wall_time), 0, 1, 0, 1},
24892 {&__pyx_n_s_trace, __pyx_k_trace,
sizeof(__pyx_k_trace), 0, 0, 1, 1},
24893 {&__pyx_n_s_trace_estimator_trace_estimator, __pyx_k_trace_estimator_trace_estimator,
sizeof(__pyx_k_trace_estimator_trace_estimator), 0, 0, 1, 1},
24894 {&__pyx_kp_s_unable_to_allocate_array_data, __pyx_k_unable_to_allocate_array_data,
sizeof(__pyx_k_unable_to_allocate_array_data), 0, 0, 1, 0},
24895 {&__pyx_kp_s_unable_to_allocate_shape_and_str, __pyx_k_unable_to_allocate_shape_and_str,
sizeof(__pyx_k_unable_to_allocate_shape_and_str), 0, 0, 1, 0},
24896 {&__pyx_n_s_unpack, __pyx_k_unpack,
sizeof(__pyx_k_unpack), 0, 0, 1, 1},
24897 {&__pyx_n_s_update, __pyx_k_update,
sizeof(__pyx_k_update), 0, 0, 1, 1},
24898 {&__pyx_n_s_vector_size, __pyx_k_vector_size,
sizeof(__pyx_k_vector_size), 0, 0, 1, 1},
24899 {&__pyx_n_s_verbose, __pyx_k_verbose,
sizeof(__pyx_k_verbose), 0, 0, 1, 1},
24900 {&__pyx_n_u_version, __pyx_k_version,
sizeof(__pyx_k_version), 0, 1, 0, 1},
24901 {&__pyx_n_s_version_2, __pyx_k_version_2,
sizeof(__pyx_k_version_2), 0, 0, 1, 1},
24902 {&__pyx_n_s_zeros, __pyx_k_zeros,
sizeof(__pyx_k_zeros), 0, 0, 1, 1},
24903 {0, 0, 0, 0, 0, 0, 0}
24905 static CYTHON_SMALL_CODE
int __Pyx_InitCachedBuiltins(
void) {
24906 __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError);
if (!__pyx_builtin_TypeError) __PYX_ERR(0, 646, __pyx_L1_error)
24907 __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range);
if (!__pyx_builtin_range) __PYX_ERR(0, 780, __pyx_L1_error)
24908 __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError);
if (!__pyx_builtin_RuntimeError) __PYX_ERR(0, 955, __pyx_L1_error)
24909 __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError);
if (!__pyx_builtin_ValueError) __PYX_ERR(1, 134, __pyx_L1_error)
24910 __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError);
if (!__pyx_builtin_MemoryError) __PYX_ERR(1, 149, __pyx_L1_error)
24911 __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate);
if (!__pyx_builtin_enumerate) __PYX_ERR(1, 152, __pyx_L1_error)
24912 __pyx_builtin_Ellipsis = __Pyx_GetBuiltinName(__pyx_n_s_Ellipsis);
if (!__pyx_builtin_Ellipsis) __PYX_ERR(1, 406, __pyx_L1_error)
24913 __pyx_builtin_id = __Pyx_GetBuiltinName(__pyx_n_s_id);
if (!__pyx_builtin_id) __PYX_ERR(1, 615, __pyx_L1_error)
24914 __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError);
if (!__pyx_builtin_IndexError) __PYX_ERR(1, 834, __pyx_L1_error)
24920 static CYTHON_SMALL_CODE
int __Pyx_InitCachedConstants(
void) {
24921 __Pyx_RefNannyDeclarations
24922 __Pyx_RefNannySetupContext(
"__Pyx_InitCachedConstants", 0);
24931 __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_u_Data_type_should_be_either_float);
if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 646, __pyx_L1_error)
24932 __Pyx_GOTREF(__pyx_tuple__2);
24933 __Pyx_GIVEREF(__pyx_tuple__2);
24942 __pyx_slice__4 = PySlice_New(Py_None, Py_None, Py_None);
if (unlikely(!__pyx_slice__4)) __PYX_ERR(0, 762, __pyx_L1_error)
24943 __Pyx_GOTREF(__pyx_slice__4);
24944 __Pyx_GIVEREF(__pyx_slice__4);
24953 __pyx_tuple__6 = PyTuple_Pack(1, __pyx_kp_u_AtA_cannot_be_None);
if (unlikely(!__pyx_tuple__6)) __PYX_ERR(0, 955, __pyx_L1_error)
24954 __Pyx_GOTREF(__pyx_tuple__6);
24955 __Pyx_GIVEREF(__pyx_tuple__6);
24964 __pyx_tuple__8 = PyTuple_Pack(1, __pyx_kp_s_Empty_shape_tuple_for_cython_arr);
if (unlikely(!__pyx_tuple__8)) __PYX_ERR(1, 134, __pyx_L1_error)
24965 __Pyx_GOTREF(__pyx_tuple__8);
24966 __Pyx_GIVEREF(__pyx_tuple__8);
24975 __pyx_tuple__9 = PyTuple_Pack(1, __pyx_kp_s_itemsize_0_for_cython_array);
if (unlikely(!__pyx_tuple__9)) __PYX_ERR(1, 137, __pyx_L1_error)
24976 __Pyx_GOTREF(__pyx_tuple__9);
24977 __Pyx_GIVEREF(__pyx_tuple__9);
24986 __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_shape_and_str);
if (unlikely(!__pyx_tuple__10)) __PYX_ERR(1, 149, __pyx_L1_error)
24987 __Pyx_GOTREF(__pyx_tuple__10);
24988 __Pyx_GIVEREF(__pyx_tuple__10);
24997 __pyx_tuple__11 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_array_data);
if (unlikely(!__pyx_tuple__11)) __PYX_ERR(1, 177, __pyx_L1_error)
24998 __Pyx_GOTREF(__pyx_tuple__11);
24999 __Pyx_GIVEREF(__pyx_tuple__11);
25008 __pyx_tuple__12 = PyTuple_Pack(1, __pyx_kp_s_Can_only_create_a_buffer_that_is);
if (unlikely(!__pyx_tuple__12)) __PYX_ERR(1, 193, __pyx_L1_error)
25009 __Pyx_GOTREF(__pyx_tuple__12);
25010 __Pyx_GIVEREF(__pyx_tuple__12);
25018 __pyx_tuple__13 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non);
if (unlikely(!__pyx_tuple__13)) __PYX_ERR(1, 2, __pyx_L1_error)
25019 __Pyx_GOTREF(__pyx_tuple__13);
25020 __Pyx_GIVEREF(__pyx_tuple__13);
25027 __pyx_tuple__14 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non);
if (unlikely(!__pyx_tuple__14)) __PYX_ERR(1, 4, __pyx_L1_error)
25028 __Pyx_GOTREF(__pyx_tuple__14);
25029 __Pyx_GIVEREF(__pyx_tuple__14);
25038 __pyx_tuple__15 = PyTuple_Pack(1, __pyx_kp_s_Cannot_assign_to_read_only_memor);
if (unlikely(!__pyx_tuple__15)) __PYX_ERR(1, 420, __pyx_L1_error)
25039 __Pyx_GOTREF(__pyx_tuple__15);
25040 __Pyx_GIVEREF(__pyx_tuple__15);
25049 __pyx_tuple__16 = PyTuple_Pack(1, __pyx_kp_s_Unable_to_convert_item_to_object);
if (unlikely(!__pyx_tuple__16)) __PYX_ERR(1, 497, __pyx_L1_error)
25050 __Pyx_GOTREF(__pyx_tuple__16);
25051 __Pyx_GIVEREF(__pyx_tuple__16);
25060 __pyx_tuple__17 = PyTuple_Pack(1, __pyx_kp_s_Cannot_create_writable_memory_vi);
if (unlikely(!__pyx_tuple__17)) __PYX_ERR(1, 522, __pyx_L1_error)
25061 __Pyx_GOTREF(__pyx_tuple__17);
25062 __Pyx_GIVEREF(__pyx_tuple__17);
25071 __pyx_tuple__18 = PyTuple_Pack(1, __pyx_kp_s_Buffer_view_does_not_expose_stri);
if (unlikely(!__pyx_tuple__18)) __PYX_ERR(1, 572, __pyx_L1_error)
25072 __Pyx_GOTREF(__pyx_tuple__18);
25073 __Pyx_GIVEREF(__pyx_tuple__18);
25082 __pyx_tuple__19 = PyTuple_New(1);
if (unlikely(!__pyx_tuple__19)) __PYX_ERR(1, 579, __pyx_L1_error)
25083 __Pyx_GOTREF(__pyx_tuple__19);
25084 __Pyx_INCREF(__pyx_int_neg_1);
25085 __Pyx_GIVEREF(__pyx_int_neg_1);
25086 PyTuple_SET_ITEM(__pyx_tuple__19, 0, __pyx_int_neg_1);
25087 __Pyx_GIVEREF(__pyx_tuple__19);
25095 __pyx_tuple__20 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non);
if (unlikely(!__pyx_tuple__20)) __PYX_ERR(1, 2, __pyx_L1_error)
25096 __Pyx_GOTREF(__pyx_tuple__20);
25097 __Pyx_GIVEREF(__pyx_tuple__20);
25104 __pyx_tuple__21 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non);
if (unlikely(!__pyx_tuple__21)) __PYX_ERR(1, 4, __pyx_L1_error)
25105 __Pyx_GOTREF(__pyx_tuple__21);
25106 __Pyx_GIVEREF(__pyx_tuple__21);
25115 __pyx_tuple__22 = PyTuple_Pack(1, __pyx_kp_s_Indirect_dimensions_not_supporte);
if (unlikely(!__pyx_tuple__22)) __PYX_ERR(1, 705, __pyx_L1_error)
25116 __Pyx_GOTREF(__pyx_tuple__22);
25117 __Pyx_GIVEREF(__pyx_tuple__22);
25125 __pyx_tuple__23 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non);
if (unlikely(!__pyx_tuple__23)) __PYX_ERR(1, 2, __pyx_L1_error)
25126 __Pyx_GOTREF(__pyx_tuple__23);
25127 __Pyx_GIVEREF(__pyx_tuple__23);
25134 __pyx_tuple__24 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non);
if (unlikely(!__pyx_tuple__24)) __PYX_ERR(1, 4, __pyx_L1_error)
25135 __Pyx_GOTREF(__pyx_tuple__24);
25136 __Pyx_GIVEREF(__pyx_tuple__24);
25137 __pyx_tuple__26 = PyTuple_Pack(3, __pyx_int_184977713, __pyx_int_136983863, __pyx_int_112105877);
if (unlikely(!__pyx_tuple__26)) __PYX_ERR(1, 4, __pyx_L1_error)
25138 __Pyx_GOTREF(__pyx_tuple__26);
25139 __Pyx_GIVEREF(__pyx_tuple__26);
25148 __pyx_tuple__27 = PyTuple_Pack(32, __pyx_n_s_A, __pyx_n_s_gram, __pyx_n_s_p, __pyx_n_s_return_info, __pyx_n_s_B, __pyx_n_s_C, __pyx_n_s_assume_matrix, __pyx_n_s_min_num_samples, __pyx_n_s_max_num_samples, __pyx_n_s_error_atol, __pyx_n_s_error_rtol, __pyx_n_s_confidence_level, __pyx_n_s_outlier_significance_level, __pyx_n_s_solver_tol, __pyx_n_s_orthogonalize, __pyx_n_s_num_threads, __pyx_n_s_verbose, __pyx_n_s_plot, __pyx_n_s_square, __pyx_n_s_data_type_name, __pyx_n_s_trace, __pyx_n_s_error, __pyx_n_s_num_outliers, __pyx_n_s_samples, __pyx_n_s_processed_samples_indices, __pyx_n_s_num_processed_samples, __pyx_n_s_num_samples_used, __pyx_n_s_converged, __pyx_n_s_tot_wall_time, __pyx_n_s_alg_wall_time, __pyx_n_s_cpu_proc_time, __pyx_n_s_info);
if (unlikely(!__pyx_tuple__27)) __PYX_ERR(0, 37, __pyx_L1_error)
25149 __Pyx_GOTREF(__pyx_tuple__27);
25150 __Pyx_GIVEREF(__pyx_tuple__27);
25151 __pyx_codeobj_ = (PyObject*)__Pyx_PyCode_New(18, 0, 32, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__27, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_imate_traceinv__hutchinson_metho, __pyx_n_s_hutchinson_method, 37, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj_)) __PYX_ERR(0, 37, __pyx_L1_error)
25152 __pyx_tuple__28 = PyTuple_Pack(17, ((PyObject *)Py_False), ((PyObject *)__pyx_int_1), ((PyObject *)Py_False), ((PyObject *)Py_None), ((PyObject *)Py_None), ((PyObject*)__pyx_n_u_gen), ((PyObject *)__pyx_int_10), ((PyObject *)__pyx_int_50), ((PyObject *)Py_None), ((PyObject*)__pyx_float_1eneg_2), ((PyObject*)__pyx_float_0_95), ((PyObject*)__pyx_float_0_001), ((PyObject*)__pyx_float_1eneg_6), ((PyObject *)Py_True), ((PyObject *)__pyx_int_0), ((PyObject *)Py_False), ((PyObject *)Py_False));
if (unlikely(!__pyx_tuple__28)) __PYX_ERR(0, 37, __pyx_L1_error)
25153 __Pyx_GOTREF(__pyx_tuple__28);
25154 __Pyx_GIVEREF(__pyx_tuple__28);
25163 __pyx_tuple__29 = PyTuple_Pack(35, __pyx_n_s_A, __pyx_n_s_B, __pyx_n_s_C, __pyx_n_s_gram, __pyx_n_s_p, __pyx_n_s_assume_matrix, __pyx_n_s_min_num_samples, __pyx_n_s_max_num_samples, __pyx_n_s_error_atol, __pyx_n_s_error_rtol, __pyx_n_s_confidence_level, __pyx_n_s_outlier_significance_level, __pyx_n_s_solver_tol, __pyx_n_s_orthogonalize, __pyx_n_s_num_threads, __pyx_n_s_vector_size, __pyx_n_s_E, __pyx_n_s_memoryview_E, __pyx_n_s_cE, __pyx_n_s_init_tot_wall_time, __pyx_n_s_init_cpu_proc_time, __pyx_n_s_samples, __pyx_n_s_processed_samples_indices, __pyx_n_s_num_processed_samples, __pyx_n_s_num_samples_used, __pyx_n_s_converged, __pyx_n_s_init_alg_wall_time, __pyx_n_s_AtA, __pyx_n_s_i, __pyx_n_s_alg_wall_time, __pyx_n_s_trace, __pyx_n_s_error, __pyx_n_s_num_outliers, __pyx_n_s_tot_wall_time, __pyx_n_s_cpu_proc_time);
if (unlikely(!__pyx_tuple__29)) __PYX_ERR(0, 722, __pyx_L1_error)
25164 __Pyx_GOTREF(__pyx_tuple__29);
25165 __Pyx_GIVEREF(__pyx_tuple__29);
25166 __pyx_codeobj__3 = (PyObject*)__Pyx_PyCode_New(15, 0, 35, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__29, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_imate_traceinv__hutchinson_metho, __pyx_n_s_hutchinson_method_float, 722, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__3)) __PYX_ERR(0, 722, __pyx_L1_error)
25175 __pyx_tuple__30 = PyTuple_Pack(35, __pyx_n_s_A, __pyx_n_s_B, __pyx_n_s_C, __pyx_n_s_gram, __pyx_n_s_p, __pyx_n_s_assume_matrix, __pyx_n_s_min_num_samples, __pyx_n_s_max_num_samples, __pyx_n_s_error_atol, __pyx_n_s_error_rtol, __pyx_n_s_confidence_level, __pyx_n_s_outlier_significance_level, __pyx_n_s_solver_tol, __pyx_n_s_orthogonalize, __pyx_n_s_num_threads, __pyx_n_s_vector_size, __pyx_n_s_E, __pyx_n_s_memoryview_E, __pyx_n_s_cE, __pyx_n_s_init_tot_wall_time, __pyx_n_s_init_cpu_proc_time, __pyx_n_s_samples, __pyx_n_s_processed_samples_indices, __pyx_n_s_num_processed_samples, __pyx_n_s_num_samples_used, __pyx_n_s_converged, __pyx_n_s_init_alg_wall_time, __pyx_n_s_AtA, __pyx_n_s_i, __pyx_n_s_alg_wall_time, __pyx_n_s_trace, __pyx_n_s_error, __pyx_n_s_num_outliers, __pyx_n_s_tot_wall_time, __pyx_n_s_cpu_proc_time);
if (unlikely(!__pyx_tuple__30)) __PYX_ERR(0, 818, __pyx_L1_error)
25176 __Pyx_GOTREF(__pyx_tuple__30);
25177 __Pyx_GIVEREF(__pyx_tuple__30);
25178 __pyx_codeobj__5 = (PyObject*)__Pyx_PyCode_New(15, 0, 35, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__30, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_imate_traceinv__hutchinson_metho, __pyx_n_s_hutchinson_method_double, 818, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__5)) __PYX_ERR(0, 818, __pyx_L1_error)
25187 __pyx_tuple__31 = PyTuple_Pack(12, __pyx_n_s_A, __pyx_n_s_AtA, __pyx_n_s_p, __pyx_n_s_gram, __pyx_n_s_assume_matrix, __pyx_n_s_solver_tol, __pyx_n_s_B, __pyx_n_s_E, __pyx_n_s_BE, __pyx_n_s_OpE, __pyx_n_s_i, __pyx_n_s_AinvpE);
if (unlikely(!__pyx_tuple__31)) __PYX_ERR(0, 1072, __pyx_L1_error)
25188 __Pyx_GOTREF(__pyx_tuple__31);
25189 __Pyx_GIVEREF(__pyx_tuple__31);
25190 __pyx_codeobj__7 = (PyObject*)__Pyx_PyCode_New(8, 0, 12, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__31, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_imate_traceinv__hutchinson_metho, __pyx_n_s_operator_dot, 1072, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__7)) __PYX_ERR(0, 1072, __pyx_L1_error)
25199 __pyx_tuple__32 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct_or_indirect);
if (unlikely(!__pyx_tuple__32)) __PYX_ERR(1, 287, __pyx_L1_error)
25200 __Pyx_GOTREF(__pyx_tuple__32);
25201 __Pyx_GIVEREF(__pyx_tuple__32);
25210 __pyx_tuple__33 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct);
if (unlikely(!__pyx_tuple__33)) __PYX_ERR(1, 288, __pyx_L1_error)
25211 __Pyx_GOTREF(__pyx_tuple__33);
25212 __Pyx_GIVEREF(__pyx_tuple__33);
25221 __pyx_tuple__34 = PyTuple_Pack(1, __pyx_kp_s_strided_and_indirect);
if (unlikely(!__pyx_tuple__34)) __PYX_ERR(1, 289, __pyx_L1_error)
25222 __Pyx_GOTREF(__pyx_tuple__34);
25223 __Pyx_GIVEREF(__pyx_tuple__34);
25232 __pyx_tuple__35 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_direct);
if (unlikely(!__pyx_tuple__35)) __PYX_ERR(1, 292, __pyx_L1_error)
25233 __Pyx_GOTREF(__pyx_tuple__35);
25234 __Pyx_GIVEREF(__pyx_tuple__35);
25243 __pyx_tuple__36 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_indirect);
if (unlikely(!__pyx_tuple__36)) __PYX_ERR(1, 293, __pyx_L1_error)
25244 __Pyx_GOTREF(__pyx_tuple__36);
25245 __Pyx_GIVEREF(__pyx_tuple__36);
25252 __pyx_tuple__37 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_pyx_PickleError, __pyx_n_s_pyx_result);
if (unlikely(!__pyx_tuple__37)) __PYX_ERR(1, 1, __pyx_L1_error)
25253 __Pyx_GOTREF(__pyx_tuple__37);
25254 __Pyx_GIVEREF(__pyx_tuple__37);
25255 __pyx_codeobj__25 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__37, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_Enum, 1, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__25)) __PYX_ERR(1, 1, __pyx_L1_error)
25256 __Pyx_RefNannyFinishContext();
25259 __Pyx_RefNannyFinishContext();
25263 static CYTHON_SMALL_CODE
int __Pyx_InitGlobals(
void) {
25265 __Pyx_init_assertions_enabled();
25267 if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error)
25269 if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
25270 __pyx_float_0_95 = PyFloat_FromDouble(0.95);
if (unlikely(!__pyx_float_0_95)) __PYX_ERR(0, 1, __pyx_L1_error)
25271 __pyx_float_1eneg_2 = PyFloat_FromDouble(1e-2);
if (unlikely(!__pyx_float_1eneg_2)) __PYX_ERR(0, 1, __pyx_L1_error)
25272 __pyx_float_1eneg_6 = PyFloat_FromDouble(1e-6);
if (unlikely(!__pyx_float_1eneg_6)) __PYX_ERR(0, 1, __pyx_L1_error)
25273 __pyx_float_0_001 = PyFloat_FromDouble(0.001);
if (unlikely(!__pyx_float_0_001)) __PYX_ERR(0, 1, __pyx_L1_error)
25274 __pyx_int_0 = PyInt_FromLong(0);
if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error)
25275 __pyx_int_1 = PyInt_FromLong(1);
if (unlikely(!__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error)
25276 __pyx_int_10 = PyInt_FromLong(10);
if (unlikely(!__pyx_int_10)) __PYX_ERR(0, 1, __pyx_L1_error)
25277 __pyx_int_50 = PyInt_FromLong(50);
if (unlikely(!__pyx_int_50)) __PYX_ERR(0, 1, __pyx_L1_error)
25278 __pyx_int_112105877 = PyInt_FromLong(112105877L);
if (unlikely(!__pyx_int_112105877)) __PYX_ERR(0, 1, __pyx_L1_error)
25279 __pyx_int_136983863 = PyInt_FromLong(136983863L);
if (unlikely(!__pyx_int_136983863)) __PYX_ERR(0, 1, __pyx_L1_error)
25280 __pyx_int_184977713 = PyInt_FromLong(184977713L);
if (unlikely(!__pyx_int_184977713)) __PYX_ERR(0, 1, __pyx_L1_error)
25281 __pyx_int_neg_1 = PyInt_FromLong(-1);
if (unlikely(!__pyx_int_neg_1)) __PYX_ERR(0, 1, __pyx_L1_error)
25287 static CYTHON_SMALL_CODE
int __Pyx_modinit_global_init_code(
void);
25288 static CYTHON_SMALL_CODE
int __Pyx_modinit_variable_export_code(
void);
25289 static CYTHON_SMALL_CODE
int __Pyx_modinit_function_export_code(
void);
25290 static CYTHON_SMALL_CODE
int __Pyx_modinit_type_init_code(
void);
25291 static CYTHON_SMALL_CODE
int __Pyx_modinit_type_import_code(
void);
25292 static CYTHON_SMALL_CODE
int __Pyx_modinit_variable_import_code(
void);
25293 static CYTHON_SMALL_CODE
int __Pyx_modinit_function_import_code(
void);
25295 static int __Pyx_modinit_global_init_code(
void) {
25296 __Pyx_RefNannyDeclarations
25297 __Pyx_RefNannySetupContext(
"__Pyx_modinit_global_init_code", 0);
25299 generic = Py_None; Py_INCREF(Py_None);
25300 strided = Py_None; Py_INCREF(Py_None);
25301 indirect = Py_None; Py_INCREF(Py_None);
25302 contiguous = Py_None; Py_INCREF(Py_None);
25303 indirect_contiguous = Py_None; Py_INCREF(Py_None);
25304 __Pyx_RefNannyFinishContext();
25308 static int __Pyx_modinit_variable_export_code(
void) {
25309 __Pyx_RefNannyDeclarations
25310 __Pyx_RefNannySetupContext(
"__Pyx_modinit_variable_export_code", 0);
25312 __Pyx_RefNannyFinishContext();
25316 static int __Pyx_modinit_function_export_code(
void) {
25317 __Pyx_RefNannyDeclarations
25318 __Pyx_RefNannySetupContext(
"__Pyx_modinit_function_export_code", 0);
25320 __Pyx_RefNannyFinishContext();
25324 static int __Pyx_modinit_type_init_code(
void) {
25325 __Pyx_RefNannyDeclarations
25326 int __pyx_lineno = 0;
25327 const char *__pyx_filename = NULL;
25328 int __pyx_clineno = 0;
25329 __Pyx_RefNannySetupContext(
"__Pyx_modinit_type_init_code", 0);
25331 __pyx_vtabptr_array = &__pyx_vtable_array;
25332 __pyx_vtable_array.get_memview = (PyObject *(*)(
struct __pyx_array_obj *))__pyx_array_get_memview;
25333 if (PyType_Ready(&__pyx_type___pyx_array) < 0) __PYX_ERR(1, 106, __pyx_L1_error)
25334 #if PY_VERSION_HEX < 0x030800B1
25335 __pyx_type___pyx_array.tp_print = 0;
25337 if (__Pyx_SetVtable(__pyx_type___pyx_array.tp_dict, __pyx_vtabptr_array) < 0) __PYX_ERR(1, 106, __pyx_L1_error)
25338 if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_array) < 0) __PYX_ERR(1, 106, __pyx_L1_error)
25339 __pyx_array_type = &__pyx_type___pyx_array;
25340 if (PyType_Ready(&__pyx_type___pyx_MemviewEnum) < 0) __PYX_ERR(1, 280, __pyx_L1_error)
25341 #if PY_VERSION_HEX < 0x030800B1
25342 __pyx_type___pyx_MemviewEnum.tp_print = 0;
25344 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type___pyx_MemviewEnum.tp_dictoffset && __pyx_type___pyx_MemviewEnum.tp_getattro == PyObject_GenericGetAttr)) {
25345 __pyx_type___pyx_MemviewEnum.tp_getattro = __Pyx_PyObject_GenericGetAttr;
25347 if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_MemviewEnum) < 0) __PYX_ERR(1, 280, __pyx_L1_error)
25348 __pyx_MemviewEnum_type = &__pyx_type___pyx_MemviewEnum;
25349 __pyx_vtabptr_memoryview = &__pyx_vtable_memoryview;
25350 __pyx_vtable_memoryview.get_item_pointer = (
char *(*)(
struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_get_item_pointer;
25351 __pyx_vtable_memoryview.is_slice = (PyObject *(*)(
struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_is_slice;
25352 __pyx_vtable_memoryview.setitem_slice_assignment = (PyObject *(*)(
struct __pyx_memoryview_obj *, PyObject *, PyObject *))__pyx_memoryview_setitem_slice_assignment;
25353 __pyx_vtable_memoryview.setitem_slice_assign_scalar = (PyObject *(*)(
struct __pyx_memoryview_obj *,
struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_setitem_slice_assign_scalar;
25354 __pyx_vtable_memoryview.setitem_indexed = (PyObject *(*)(
struct __pyx_memoryview_obj *, PyObject *, PyObject *))__pyx_memoryview_setitem_indexed;
25355 __pyx_vtable_memoryview.convert_item_to_object = (PyObject *(*)(
struct __pyx_memoryview_obj *,
char *))__pyx_memoryview_convert_item_to_object;
25356 __pyx_vtable_memoryview.assign_item_from_object = (PyObject *(*)(
struct __pyx_memoryview_obj *,
char *, PyObject *))__pyx_memoryview_assign_item_from_object;
25357 if (PyType_Ready(&__pyx_type___pyx_memoryview) < 0) __PYX_ERR(1, 331, __pyx_L1_error)
25358 #if PY_VERSION_HEX < 0x030800B1
25359 __pyx_type___pyx_memoryview.tp_print = 0;
25361 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type___pyx_memoryview.tp_dictoffset && __pyx_type___pyx_memoryview.tp_getattro == PyObject_GenericGetAttr)) {
25362 __pyx_type___pyx_memoryview.tp_getattro = __Pyx_PyObject_GenericGetAttr;
25364 if (__Pyx_SetVtable(__pyx_type___pyx_memoryview.tp_dict, __pyx_vtabptr_memoryview) < 0) __PYX_ERR(1, 331, __pyx_L1_error)
25365 if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_memoryview) < 0) __PYX_ERR(1, 331, __pyx_L1_error)
25366 __pyx_memoryview_type = &__pyx_type___pyx_memoryview;
25367 __pyx_vtabptr__memoryviewslice = &__pyx_vtable__memoryviewslice;
25368 __pyx_vtable__memoryviewslice.__pyx_base = *__pyx_vtabptr_memoryview;
25369 __pyx_vtable__memoryviewslice.__pyx_base.convert_item_to_object = (PyObject *(*)(
struct __pyx_memoryview_obj *,
char *))__pyx_memoryviewslice_convert_item_to_object;
25370 __pyx_vtable__memoryviewslice.__pyx_base.assign_item_from_object = (PyObject *(*)(
struct __pyx_memoryview_obj *,
char *, PyObject *))__pyx_memoryviewslice_assign_item_from_object;
25371 __pyx_type___pyx_memoryviewslice.tp_base = __pyx_memoryview_type;
25372 if (PyType_Ready(&__pyx_type___pyx_memoryviewslice) < 0) __PYX_ERR(1, 967, __pyx_L1_error)
25373 #if PY_VERSION_HEX < 0x030800B1
25374 __pyx_type___pyx_memoryviewslice.tp_print = 0;
25376 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type___pyx_memoryviewslice.tp_dictoffset && __pyx_type___pyx_memoryviewslice.tp_getattro == PyObject_GenericGetAttr)) {
25377 __pyx_type___pyx_memoryviewslice.tp_getattro = __Pyx_PyObject_GenericGetAttr;
25379 if (__Pyx_SetVtable(__pyx_type___pyx_memoryviewslice.tp_dict, __pyx_vtabptr__memoryviewslice) < 0) __PYX_ERR(1, 967, __pyx_L1_error)
25380 if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_memoryviewslice) < 0) __PYX_ERR(1, 967, __pyx_L1_error)
25381 __pyx_memoryviewslice_type = &__pyx_type___pyx_memoryviewslice;
25382 __Pyx_RefNannyFinishContext();
25385 __Pyx_RefNannyFinishContext();
25389 static int __Pyx_modinit_type_import_code(
void) {
25390 __Pyx_RefNannyDeclarations
25391 __Pyx_RefNannySetupContext(
"__Pyx_modinit_type_import_code", 0);
25393 __Pyx_RefNannyFinishContext();
25397 static int __Pyx_modinit_variable_import_code(
void) {
25398 __Pyx_RefNannyDeclarations
25399 __Pyx_RefNannySetupContext(
"__Pyx_modinit_variable_import_code", 0);
25401 __Pyx_RefNannyFinishContext();
25405 static int __Pyx_modinit_function_import_code(
void) {
25406 __Pyx_RefNannyDeclarations
25407 PyObject *__pyx_t_1 = NULL;
25408 int __pyx_lineno = 0;
25409 const char *__pyx_filename = NULL;
25410 int __pyx_clineno = 0;
25411 __Pyx_RefNannySetupContext(
"__Pyx_modinit_function_import_code", 0);
25413 __pyx_t_1 = PyImport_ImportModule(
"imate._linear_algebra.orthogonalization");
if (!__pyx_t_1) __PYX_ERR(0, 1, __pyx_L1_error)
25414 __Pyx_GOTREF(__pyx_t_1);
25415 if (__Pyx_ImportFunction_0_29_36(__pyx_t_1,
"__pyx_fuse_0orthogonalize_vectors", (
void (**)(
void))&__pyx_fuse_0__pyx_f_5imate_15_linear_algebra_17orthogonalization_orthogonalize_vectors,
"void (float *, __pyx_t_5imate_12_definitions_5types_LongIndexType const , __pyx_t_5imate_12_definitions_5types_IndexType const )") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
25416 if (__Pyx_ImportFunction_0_29_36(__pyx_t_1,
"__pyx_fuse_1orthogonalize_vectors", (
void (**)(
void))&__pyx_fuse_1__pyx_f_5imate_15_linear_algebra_17orthogonalization_orthogonalize_vectors,
"void (double *, __pyx_t_5imate_12_definitions_5types_LongIndexType const , __pyx_t_5imate_12_definitions_5types_IndexType const )") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
25417 if (__Pyx_ImportFunction_0_29_36(__pyx_t_1,
"__pyx_fuse_2orthogonalize_vectors", (
void (**)(
void))&__pyx_fuse_2__pyx_f_5imate_15_linear_algebra_17orthogonalization_orthogonalize_vectors,
"void (long double *, __pyx_t_5imate_12_definitions_5types_LongIndexType const , __pyx_t_5imate_12_definitions_5types_IndexType const )") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
25418 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
25419 __pyx_t_1 = PyImport_ImportModule(
"imate._linear_algebra.random_vectors");
if (!__pyx_t_1) __PYX_ERR(0, 1, __pyx_L1_error)
25420 __Pyx_GOTREF(__pyx_t_1);
25421 if (__Pyx_ImportFunction_0_29_36(__pyx_t_1,
"__pyx_fuse_0generate_random_column_vectors", (
void (**)(
void))&__pyx_fuse_0__pyx_f_5imate_15_linear_algebra_14random_vectors_generate_random_column_vectors,
"void (float *, __pyx_t_5imate_12_definitions_5types_LongIndexType const , __pyx_t_5imate_12_definitions_5types_IndexType const , __pyx_t_5imate_12_definitions_5types_IndexType const , __pyx_t_5imate_12_definitions_5types_IndexType const )") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
25422 if (__Pyx_ImportFunction_0_29_36(__pyx_t_1,
"__pyx_fuse_1generate_random_column_vectors", (
void (**)(
void))&__pyx_fuse_1__pyx_f_5imate_15_linear_algebra_14random_vectors_generate_random_column_vectors,
"void (double *, __pyx_t_5imate_12_definitions_5types_LongIndexType const , __pyx_t_5imate_12_definitions_5types_IndexType const , __pyx_t_5imate_12_definitions_5types_IndexType const , __pyx_t_5imate_12_definitions_5types_IndexType const )") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
25423 if (__Pyx_ImportFunction_0_29_36(__pyx_t_1,
"__pyx_fuse_2generate_random_column_vectors", (
void (**)(
void))&__pyx_fuse_2__pyx_f_5imate_15_linear_algebra_14random_vectors_generate_random_column_vectors,
"void (long double *, __pyx_t_5imate_12_definitions_5types_LongIndexType const , __pyx_t_5imate_12_definitions_5types_IndexType const , __pyx_t_5imate_12_definitions_5types_IndexType const , __pyx_t_5imate_12_definitions_5types_IndexType const )") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
25424 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
25425 __Pyx_RefNannyFinishContext();
25428 __Pyx_XDECREF(__pyx_t_1);
25429 __Pyx_RefNannyFinishContext();
25434 #ifndef CYTHON_NO_PYINIT_EXPORT
25435 #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
25436 #elif PY_MAJOR_VERSION < 3
25438 #define __Pyx_PyMODINIT_FUNC extern "C" void
25440 #define __Pyx_PyMODINIT_FUNC void
25444 #define __Pyx_PyMODINIT_FUNC extern "C" PyObject *
25446 #define __Pyx_PyMODINIT_FUNC PyObject *
25451 #if PY_MAJOR_VERSION < 3
25452 __Pyx_PyMODINIT_FUNC init_hutchinson_method(
void) CYTHON_SMALL_CODE;
25453 __Pyx_PyMODINIT_FUNC init_hutchinson_method(
void)
25455 __Pyx_PyMODINIT_FUNC PyInit__hutchinson_method(
void) CYTHON_SMALL_CODE;
25456 __Pyx_PyMODINIT_FUNC PyInit__hutchinson_method(
void)
25457 #if CYTHON_PEP489_MULTI_PHASE_INIT
25459 return PyModuleDef_Init(&__pyx_moduledef);
25461 static CYTHON_SMALL_CODE
int __Pyx_check_single_interpreter(
void) {
25462 #if PY_VERSION_HEX >= 0x030700A1
25463 static PY_INT64_T main_interpreter_id = -1;
25464 PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp);
25465 if (main_interpreter_id == -1) {
25466 main_interpreter_id = current_id;
25467 return (unlikely(current_id == -1)) ? -1 : 0;
25468 }
else if (unlikely(main_interpreter_id != current_id))
25470 static PyInterpreterState *main_interpreter = NULL;
25471 PyInterpreterState *current_interpreter = PyThreadState_Get()->interp;
25472 if (!main_interpreter) {
25473 main_interpreter = current_interpreter;
25474 }
else if (unlikely(main_interpreter != current_interpreter))
25479 "Interpreter change detected - this module can only be loaded into one interpreter per process.");
25484 static CYTHON_SMALL_CODE
int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict,
const char* from_name,
const char* to_name,
int allow_none) {
25485 PyObject *value = PyObject_GetAttrString(spec, from_name);
25487 if (likely(value)) {
25488 if (allow_none || value != Py_None) {
25489 result = PyDict_SetItemString(moddict, to_name, value);
25492 }
else if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
25499 static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, CYTHON_UNUSED PyModuleDef *def) {
25500 PyObject *module = NULL, *moddict, *modname;
25501 if (__Pyx_check_single_interpreter())
25504 return __Pyx_NewRef(__pyx_m);
25505 modname = PyObject_GetAttrString(spec,
"name");
25506 if (unlikely(!modname))
goto bad;
25507 module = PyModule_NewObject(modname);
25508 Py_DECREF(modname);
25509 if (unlikely(!module))
goto bad;
25510 moddict = PyModule_GetDict(module);
25511 if (unlikely(!moddict))
goto bad;
25512 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict,
"loader",
"__loader__", 1) < 0))
goto bad;
25513 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict,
"origin",
"__file__", 1) < 0))
goto bad;
25514 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict,
"parent",
"__package__", 1) < 0))
goto bad;
25515 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict,
"submodule_search_locations",
"__path__", 0) < 0))
goto bad;
25518 Py_XDECREF(module);
25523 static CYTHON_SMALL_CODE
int __pyx_pymod_exec__hutchinson_method(PyObject *__pyx_pyinit_module)
25527 __Pyx_TraceDeclarations
25528 PyObject *__pyx_t_1 = NULL;
25529 PyObject *__pyx_t_2 = NULL;
25530 static PyThread_type_lock __pyx_t_3[8];
25531 int __pyx_lineno = 0;
25532 const char *__pyx_filename = NULL;
25533 int __pyx_clineno = 0;
25534 __Pyx_RefNannyDeclarations
25535 #if CYTHON_PEP489_MULTI_PHASE_INIT
25537 if (__pyx_m == __pyx_pyinit_module)
return 0;
25538 PyErr_SetString(PyExc_RuntimeError,
"Module '_hutchinson_method' has already been imported. Re-initialisation is not supported.");
25541 #elif PY_MAJOR_VERSION >= 3
25542 if (__pyx_m)
return __Pyx_NewRef(__pyx_m);
25544 #if CYTHON_REFNANNY
25545 __Pyx_RefNanny = __Pyx_RefNannyImportAPI(
"refnanny");
25546 if (!__Pyx_RefNanny) {
25548 __Pyx_RefNanny = __Pyx_RefNannyImportAPI(
"Cython.Runtime.refnanny");
25549 if (!__Pyx_RefNanny)
25550 Py_FatalError(
"failed to import 'refnanny' module");
25553 __Pyx_RefNannySetupContext(
"__Pyx_PyMODINIT_FUNC PyInit__hutchinson_method(void)", 0);
25554 if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
25555 #ifdef __Pxy_PyFrame_Initialize_Offsets
25556 __Pxy_PyFrame_Initialize_Offsets();
25558 __pyx_empty_tuple = PyTuple_New(0);
if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error)
25559 __pyx_empty_bytes = PyBytes_FromStringAndSize(
"", 0);
if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error)
25560 __pyx_empty_unicode = PyUnicode_FromStringAndSize(
"", 0);
if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error)
25561 #ifdef __Pyx_CyFunction_USED
25562 if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
25564 #ifdef __Pyx_FusedFunction_USED
25565 if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
25567 #ifdef __Pyx_Coroutine_USED
25568 if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
25570 #ifdef __Pyx_Generator_USED
25571 if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
25573 #ifdef __Pyx_AsyncGen_USED
25574 if (__pyx_AsyncGen_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
25576 #ifdef __Pyx_StopAsyncIteration_USED
25577 if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
25581 #if defined(WITH_THREAD) && PY_VERSION_HEX < 0x030700F0 && defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
25582 PyEval_InitThreads();
25585 #if CYTHON_PEP489_MULTI_PHASE_INIT
25586 __pyx_m = __pyx_pyinit_module;
25587 Py_INCREF(__pyx_m);
25589 #if PY_MAJOR_VERSION < 3
25590 __pyx_m = Py_InitModule4(
"_hutchinson_method", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
25592 __pyx_m = PyModule_Create(&__pyx_moduledef);
25594 if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error)
25596 __pyx_d = PyModule_GetDict(__pyx_m);
if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error)
25597 Py_INCREF(__pyx_d);
25598 __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME);
if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)
25599 Py_INCREF(__pyx_b);
25600 __pyx_cython_runtime = PyImport_AddModule((
char *)
"cython_runtime");
if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error)
25601 Py_INCREF(__pyx_cython_runtime);
25602 if (PyObject_SetAttrString(__pyx_m,
"__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
25604 if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
25605 #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
25606 if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
25608 if (__pyx_module_is_main_imate__traceinv___hutchinson_method) {
25609 if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name_2, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
25611 #if PY_MAJOR_VERSION >= 3
25613 PyObject *modules = PyImport_GetModuleDict();
if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error)
25614 if (!PyDict_GetItemString(modules,
"imate.traceinv._hutchinson_method")) {
25615 if (unlikely(PyDict_SetItemString(modules,
"imate.traceinv._hutchinson_method", __pyx_m) < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
25620 if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
25622 if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
25624 (void)__Pyx_modinit_global_init_code();
25625 (void)__Pyx_modinit_variable_export_code();
25626 (void)__Pyx_modinit_function_export_code();
25627 if (unlikely(__Pyx_modinit_type_init_code() < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
25628 (void)__Pyx_modinit_type_import_code();
25629 (void)__Pyx_modinit_variable_import_code();
25630 if (unlikely(__Pyx_modinit_function_import_code() < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
25632 #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
25633 if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
25635 __Pyx_TraceCall(
"__Pyx_PyMODINIT_FUNC PyInit__hutchinson_method(void)", __pyx_f[0], 1, 0, __PYX_ERR(0, 1, __pyx_L1_error));
25644 __Pyx_TraceLine(15,0,__PYX_ERR(0, 15, __pyx_L1_error))
25645 __pyx_t_1 = __Pyx_Import(__pyx_n_s_time, 0, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 15, __pyx_L1_error)
25646 __Pyx_GOTREF(__pyx_t_1);
25647 if (PyDict_SetItem(__pyx_d, __pyx_n_s_time, __pyx_t_1) < 0) __PYX_ERR(0, 15, __pyx_L1_error)
25648 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
25657 __Pyx_TraceLine(16,0,__PYX_ERR(0, 16, __pyx_L1_error))
25658 __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, 0, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 16, __pyx_L1_error)
25659 __Pyx_GOTREF(__pyx_t_1);
25660 if (PyDict_SetItem(__pyx_d, __pyx_n_s_numpy, __pyx_t_1) < 0) __PYX_ERR(0, 16, __pyx_L1_error)
25661 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
25670 __Pyx_TraceLine(17,0,__PYX_ERR(0, 17, __pyx_L1_error))
25671 __pyx_t_1 = __Pyx_Import(__pyx_n_s_scipy_sparse, 0, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 17, __pyx_L1_error)
25672 __Pyx_GOTREF(__pyx_t_1);
25673 if (PyDict_SetItem(__pyx_d, __pyx_n_s_scipy, __pyx_t_1) < 0) __PYX_ERR(0, 17, __pyx_L1_error)
25674 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
25683 __Pyx_TraceLine(18,0,__PYX_ERR(0, 18, __pyx_L1_error))
25684 __pyx_t_1 = PyList_New(1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 18, __pyx_L1_error)
25685 __Pyx_GOTREF(__pyx_t_1);
25686 __Pyx_INCREF(__pyx_n_s_isspmatrix);
25687 __Pyx_GIVEREF(__pyx_n_s_isspmatrix);
25688 PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_isspmatrix);
25689 __pyx_t_2 = __Pyx_Import(__pyx_n_s_scipy_sparse, __pyx_t_1, 0);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 18, __pyx_L1_error)
25690 __Pyx_GOTREF(__pyx_t_2);
25691 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
25692 __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_isspmatrix);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 18, __pyx_L1_error)
25693 __Pyx_GOTREF(__pyx_t_1);
25694 if (PyDict_SetItem(__pyx_d, __pyx_n_s_isspmatrix, __pyx_t_1) < 0) __PYX_ERR(0, 18, __pyx_L1_error)
25695 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
25696 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
25705 __Pyx_TraceLine(19,0,__PYX_ERR(0, 19, __pyx_L1_error))
25706 __pyx_t_2 = __Pyx_Import(__pyx_n_s_multiprocessing, 0, 0);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 19, __pyx_L1_error)
25707 __Pyx_GOTREF(__pyx_t_2);
25708 if (PyDict_SetItem(__pyx_d, __pyx_n_s_multiprocessing, __pyx_t_2) < 0) __PYX_ERR(0, 19, __pyx_L1_error)
25709 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
25718 __Pyx_TraceLine(20,0,__PYX_ERR(0, 20, __pyx_L1_error))
25719 __pyx_t_2 = PyList_New(1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 20, __pyx_L1_error)
25720 __Pyx_GOTREF(__pyx_t_2);
25721 __Pyx_INCREF(__pyx_n_s_version_2);
25722 __Pyx_GIVEREF(__pyx_n_s_version_2);
25723 PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_version_2);
25724 __pyx_t_1 = __Pyx_Import(__pyx_n_s_version_2, __pyx_t_2, 2);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 20, __pyx_L1_error)
25725 __Pyx_GOTREF(__pyx_t_1);
25726 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
25727 __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_version_2);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 20, __pyx_L1_error)
25728 __Pyx_GOTREF(__pyx_t_2);
25729 if (PyDict_SetItem(__pyx_d, __pyx_n_s_version_2, __pyx_t_2) < 0) __PYX_ERR(0, 20, __pyx_L1_error)
25730 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
25731 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
25740 __Pyx_TraceLine(21,0,__PYX_ERR(0, 21, __pyx_L1_error))
25741 __pyx_t_1 = PyList_New(1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 21, __pyx_L1_error)
25742 __Pyx_GOTREF(__pyx_t_1);
25743 __Pyx_INCREF(__pyx_n_s_linear_solver);
25744 __Pyx_GIVEREF(__pyx_n_s_linear_solver);
25745 PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_linear_solver);
25746 __pyx_t_2 = __Pyx_Import(__pyx_n_s_linear_algebra, __pyx_t_1, 2);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 21, __pyx_L1_error)
25747 __Pyx_GOTREF(__pyx_t_2);
25748 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
25749 __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_linear_solver);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 21, __pyx_L1_error)
25750 __Pyx_GOTREF(__pyx_t_1);
25751 if (PyDict_SetItem(__pyx_d, __pyx_n_s_linear_solver, __pyx_t_1) < 0) __PYX_ERR(0, 21, __pyx_L1_error)
25752 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
25753 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
25762 __Pyx_TraceLine(22,0,__PYX_ERR(0, 22, __pyx_L1_error))
25763 __pyx_t_2 = PyList_New(2);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 22, __pyx_L1_error)
25764 __Pyx_GOTREF(__pyx_t_2);
25765 __Pyx_INCREF(__pyx_n_s_check_convergence);
25766 __Pyx_GIVEREF(__pyx_n_s_check_convergence);
25767 PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_check_convergence);
25768 __Pyx_INCREF(__pyx_n_s_average_estimates);
25769 __Pyx_GIVEREF(__pyx_n_s_average_estimates);
25770 PyList_SET_ITEM(__pyx_t_2, 1, __pyx_n_s_average_estimates);
25771 __pyx_t_1 = __Pyx_Import(__pyx_n_s_convergence_tools, __pyx_t_2, 1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 22, __pyx_L1_error)
25772 __Pyx_GOTREF(__pyx_t_1);
25773 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
25774 __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_check_convergence);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 22, __pyx_L1_error)
25775 __Pyx_GOTREF(__pyx_t_2);
25776 if (PyDict_SetItem(__pyx_d, __pyx_n_s_check_convergence, __pyx_t_2) < 0) __PYX_ERR(0, 22, __pyx_L1_error)
25777 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
25778 __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_average_estimates);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 22, __pyx_L1_error)
25779 __Pyx_GOTREF(__pyx_t_2);
25780 if (PyDict_SetItem(__pyx_d, __pyx_n_s_average_estimates, __pyx_t_2) < 0) __PYX_ERR(0, 22, __pyx_L1_error)
25781 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
25782 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
25791 __Pyx_TraceLine(23,0,__PYX_ERR(0, 23, __pyx_L1_error))
25792 __pyx_t_1 = PyList_New(1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 23, __pyx_L1_error)
25793 __Pyx_GOTREF(__pyx_t_1);
25794 __Pyx_INCREF(__pyx_n_s_plot_convergence);
25795 __Pyx_GIVEREF(__pyx_n_s_plot_convergence);
25796 PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_plot_convergence);
25797 __pyx_t_2 = __Pyx_Import(__pyx_n_s_trace_estimator_trace_estimator, __pyx_t_1, 2);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 23, __pyx_L1_error)
25798 __Pyx_GOTREF(__pyx_t_2);
25799 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
25800 __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_plot_convergence);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 23, __pyx_L1_error)
25801 __Pyx_GOTREF(__pyx_t_1);
25802 if (PyDict_SetItem(__pyx_d, __pyx_n_s_plot_convergence, __pyx_t_1) < 0) __PYX_ERR(0, 23, __pyx_L1_error)
25803 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
25804 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
25813 __Pyx_TraceLine(24,0,__PYX_ERR(0, 24, __pyx_L1_error))
25814 __pyx_t_2 = PyList_New(2);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 24, __pyx_L1_error)
25815 __Pyx_GOTREF(__pyx_t_2);
25816 __Pyx_INCREF(__pyx_n_s_check_arguments);
25817 __Pyx_GIVEREF(__pyx_n_s_check_arguments);
25818 PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_check_arguments);
25819 __Pyx_INCREF(__pyx_n_s_print_summary);
25820 __Pyx_GIVEREF(__pyx_n_s_print_summary);
25821 PyList_SET_ITEM(__pyx_t_2, 1, __pyx_n_s_print_summary);
25822 __pyx_t_1 = __Pyx_Import(__pyx_n_s_hutchinson_method_utilities, __pyx_t_2, 1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 24, __pyx_L1_error)
25823 __Pyx_GOTREF(__pyx_t_1);
25824 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
25825 __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_check_arguments);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 24, __pyx_L1_error)
25826 __Pyx_GOTREF(__pyx_t_2);
25827 if (PyDict_SetItem(__pyx_d, __pyx_n_s_check_arguments, __pyx_t_2) < 0) __PYX_ERR(0, 24, __pyx_L1_error)
25828 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
25829 __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_print_summary);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 24, __pyx_L1_error)
25830 __Pyx_GOTREF(__pyx_t_2);
25831 if (PyDict_SetItem(__pyx_d, __pyx_n_s_print_summary, __pyx_t_2) < 0) __PYX_ERR(0, 24, __pyx_L1_error)
25832 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
25833 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
25842 __Pyx_TraceLine(25,0,__PYX_ERR(0, 25, __pyx_L1_error))
25843 __pyx_t_1 = PyList_New(3);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 25, __pyx_L1_error)
25844 __Pyx_GOTREF(__pyx_t_1);
25845 __Pyx_INCREF(__pyx_n_s_get_data_type_name);
25846 __Pyx_GIVEREF(__pyx_n_s_get_data_type_name);
25847 PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_get_data_type_name);
25848 __Pyx_INCREF(__pyx_n_s_get_nnz);
25849 __Pyx_GIVEREF(__pyx_n_s_get_nnz);
25850 PyList_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_get_nnz);
25851 __Pyx_INCREF(__pyx_n_s_get_density);
25852 __Pyx_GIVEREF(__pyx_n_s_get_density);
25853 PyList_SET_ITEM(__pyx_t_1, 2, __pyx_n_s_get_density);
25854 __pyx_t_2 = __Pyx_Import(__pyx_n_s_linear_algebra_matrix_utilities, __pyx_t_1, 2);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 25, __pyx_L1_error)
25855 __Pyx_GOTREF(__pyx_t_2);
25856 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
25857 __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_get_data_type_name);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 25, __pyx_L1_error)
25858 __Pyx_GOTREF(__pyx_t_1);
25859 if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_data_type_name, __pyx_t_1) < 0) __PYX_ERR(0, 25, __pyx_L1_error)
25860 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
25861 __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_get_nnz);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 25, __pyx_L1_error)
25862 __Pyx_GOTREF(__pyx_t_1);
25863 if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_nnz, __pyx_t_1) < 0) __PYX_ERR(0, 25, __pyx_L1_error)
25864 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
25865 __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_get_density);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 25, __pyx_L1_error)
25866 __Pyx_GOTREF(__pyx_t_1);
25867 if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_density, __pyx_t_1) < 0) __PYX_ERR(0, 26, __pyx_L1_error)
25868 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
25869 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
25878 __Pyx_TraceLine(37,0,__PYX_ERR(0, 37, __pyx_L1_error))
25879 __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5imate_8traceinv_18_hutchinson_method_1hutchinson_method, 0, __pyx_n_s_hutchinson_method, NULL, __pyx_n_s_imate_traceinv__hutchinson_metho_2, __pyx_d, ((PyObject *)__pyx_codeobj_));
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 37, __pyx_L1_error)
25880 __Pyx_GOTREF(__pyx_t_2);
25881 __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_tuple__28);
25882 if (PyDict_SetItem(__pyx_d, __pyx_n_s_hutchinson_method, __pyx_t_2) < 0) __PYX_ERR(0, 37, __pyx_L1_error)
25883 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
25892 __Pyx_TraceLine(722,0,__PYX_ERR(0, 722, __pyx_L1_error))
25893 __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5imate_8traceinv_18_hutchinson_method_3_hutchinson_method_float, 0, __pyx_n_s_hutchinson_method_float, NULL, __pyx_n_s_imate_traceinv__hutchinson_metho_2, __pyx_d, ((PyObject *)__pyx_codeobj__3));
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 722, __pyx_L1_error)
25894 __Pyx_GOTREF(__pyx_t_2);
25895 if (PyDict_SetItem(__pyx_d, __pyx_n_s_hutchinson_method_float, __pyx_t_2) < 0) __PYX_ERR(0, 722, __pyx_L1_error)
25896 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
25905 __Pyx_TraceLine(818,0,__PYX_ERR(0, 818, __pyx_L1_error))
25906 __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5imate_8traceinv_18_hutchinson_method_5_hutchinson_method_double, 0, __pyx_n_s_hutchinson_method_double, NULL, __pyx_n_s_imate_traceinv__hutchinson_metho_2, __pyx_d, ((PyObject *)__pyx_codeobj__5));
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 818, __pyx_L1_error)
25907 __Pyx_GOTREF(__pyx_t_2);
25908 if (PyDict_SetItem(__pyx_d, __pyx_n_s_hutchinson_method_double, __pyx_t_2) < 0) __PYX_ERR(0, 818, __pyx_L1_error)
25909 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
25918 __Pyx_TraceLine(914,0,__PYX_ERR(0, 914, __pyx_L1_error))
25928 __Pyx_TraceLine(993,0,__PYX_ERR(0, 993, __pyx_L1_error))
25938 __Pyx_TraceLine(1072,0,__PYX_ERR(0, 1072, __pyx_L1_error))
25939 __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5imate_8traceinv_18_hutchinson_method_7_operator_dot, 0, __pyx_n_s_operator_dot, NULL, __pyx_n_s_imate_traceinv__hutchinson_metho_2, __pyx_d, ((PyObject *)__pyx_codeobj__7));
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1072, __pyx_L1_error)
25940 __Pyx_GOTREF(__pyx_t_2);
25941 if (PyDict_SetItem(__pyx_d, __pyx_n_s_operator_dot, __pyx_t_2) < 0) __PYX_ERR(0, 1072, __pyx_L1_error)
25942 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
25949 __Pyx_TraceLine(1,0,__PYX_ERR(0, 1, __pyx_L1_error))
25950 __pyx_t_2 = __Pyx_PyDict_NewPresized(1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1, __pyx_L1_error)
25951 __Pyx_GOTREF(__pyx_t_2);
25952 if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_hutchinson_method_line_37, __pyx_kp_u_Trace_of_matrix_or_linear_opera) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
25953 if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
25954 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
25963 __Pyx_TraceLine(210,0,__PYX_ERR(1, 210, __pyx_L1_error))
25964 __pyx_t_2 = __pyx_capsule_create(((
void *)(&__pyx_array_getbuffer)), ((
char *)
"getbuffer(obj, view, flags)"));
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 210, __pyx_L1_error)
25965 __Pyx_GOTREF(__pyx_t_2);
25966 if (PyDict_SetItem((PyObject *)__pyx_array_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_2) < 0) __PYX_ERR(1, 210, __pyx_L1_error)
25967 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
25968 PyType_Modified(__pyx_array_type);
25977 __Pyx_TraceLine(227,0,__PYX_ERR(1, 227, __pyx_L1_error))
25987 __Pyx_TraceLine(245,0,__PYX_ERR(1, 245, __pyx_L1_error))
25997 __Pyx_TraceLine(287,0,__PYX_ERR(1, 287, __pyx_L1_error))
25998 __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__32, NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 287, __pyx_L1_error)
25999 __Pyx_GOTREF(__pyx_t_2);
26000 __Pyx_XGOTREF(
generic);
26001 __Pyx_DECREF_SET(
generic, __pyx_t_2);
26002 __Pyx_GIVEREF(__pyx_t_2);
26012 __Pyx_TraceLine(288,0,__PYX_ERR(1, 288, __pyx_L1_error))
26013 __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__33, NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 288, __pyx_L1_error)
26014 __Pyx_GOTREF(__pyx_t_2);
26015 __Pyx_XGOTREF(strided);
26016 __Pyx_DECREF_SET(strided, __pyx_t_2);
26017 __Pyx_GIVEREF(__pyx_t_2);
26027 __Pyx_TraceLine(289,0,__PYX_ERR(1, 289, __pyx_L1_error))
26028 __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__34, NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 289, __pyx_L1_error)
26029 __Pyx_GOTREF(__pyx_t_2);
26030 __Pyx_XGOTREF(indirect);
26031 __Pyx_DECREF_SET(indirect, __pyx_t_2);
26032 __Pyx_GIVEREF(__pyx_t_2);
26042 __Pyx_TraceLine(292,0,__PYX_ERR(1, 292, __pyx_L1_error))
26043 __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__35, NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 292, __pyx_L1_error)
26044 __Pyx_GOTREF(__pyx_t_2);
26045 __Pyx_XGOTREF(contiguous);
26046 __Pyx_DECREF_SET(contiguous, __pyx_t_2);
26047 __Pyx_GIVEREF(__pyx_t_2);
26057 __Pyx_TraceLine(293,0,__PYX_ERR(1, 293, __pyx_L1_error))
26058 __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__36, NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 293, __pyx_L1_error)
26059 __Pyx_GOTREF(__pyx_t_2);
26060 __Pyx_XGOTREF(indirect_contiguous);
26061 __Pyx_DECREF_SET(indirect_contiguous, __pyx_t_2);
26062 __Pyx_GIVEREF(__pyx_t_2);
26072 __Pyx_TraceLine(299,0,__PYX_ERR(1, 299, __pyx_L1_error))
26082 __Pyx_TraceLine(317,0,__PYX_ERR(1, 317, __pyx_L1_error))
26083 __pyx_memoryview_thread_locks_used = 0;
26092 __Pyx_TraceLine(318,0,__PYX_ERR(1, 318, __pyx_L1_error))
26093 __pyx_t_3[0] = PyThread_allocate_lock();
26094 __pyx_t_3[1] = PyThread_allocate_lock();
26095 __pyx_t_3[2] = PyThread_allocate_lock();
26096 __pyx_t_3[3] = PyThread_allocate_lock();
26097 __pyx_t_3[4] = PyThread_allocate_lock();
26098 __pyx_t_3[5] = PyThread_allocate_lock();
26099 __pyx_t_3[6] = PyThread_allocate_lock();
26100 __pyx_t_3[7] = PyThread_allocate_lock();
26101 memcpy(&(__pyx_memoryview_thread_locks[0]), __pyx_t_3,
sizeof(__pyx_memoryview_thread_locks[0]) * (8));
26110 __Pyx_TraceLine(395,0,__PYX_ERR(1, 395, __pyx_L1_error))
26120 __Pyx_TraceLine(433,0,__PYX_ERR(1, 433, __pyx_L1_error))
26130 __Pyx_TraceLine(443,0,__PYX_ERR(1, 443, __pyx_L1_error))
26140 __Pyx_TraceLine(451,0,__PYX_ERR(1, 451, __pyx_L1_error))
26150 __Pyx_TraceLine(483,0,__PYX_ERR(1, 483, __pyx_L1_error))
26160 __Pyx_TraceLine(487,0,__PYX_ERR(1, 487, __pyx_L1_error))
26170 __Pyx_TraceLine(503,0,__PYX_ERR(1, 503, __pyx_L1_error))
26180 __Pyx_TraceLine(551,0,__PYX_ERR(1, 551, __pyx_L1_error))
26181 __pyx_t_2 = __pyx_capsule_create(((
void *)(&__pyx_memoryview_getbuffer)), ((
char *)
"getbuffer(obj, view, flags)"));
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 551, __pyx_L1_error)
26182 __Pyx_GOTREF(__pyx_t_2);
26183 if (PyDict_SetItem((PyObject *)__pyx_memoryview_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_2) < 0) __PYX_ERR(1, 551, __pyx_L1_error)
26184 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
26185 PyType_Modified(__pyx_memoryview_type);
26194 __Pyx_TraceLine(659,0,__PYX_ERR(1, 659, __pyx_L1_error))
26204 __Pyx_TraceLine(665,0,__PYX_ERR(1, 665, __pyx_L1_error))
26214 __Pyx_TraceLine(668,0,__PYX_ERR(1, 668, __pyx_L1_error))
26224 __Pyx_TraceLine(702,0,__PYX_ERR(1, 702, __pyx_L1_error))
26234 __Pyx_TraceLine(712,0,__PYX_ERR(1, 712, __pyx_L1_error))
26244 __Pyx_TraceLine(809,0,__PYX_ERR(1, 809, __pyx_L1_error))
26254 __Pyx_TraceLine(912,0,__PYX_ERR(1, 912, __pyx_L1_error))
26264 __Pyx_TraceLine(945,0,__PYX_ERR(1, 945, __pyx_L1_error))
26274 __Pyx_TraceLine(981,0,__PYX_ERR(1, 981, __pyx_L1_error))
26284 __Pyx_TraceLine(987,0,__PYX_ERR(1, 987, __pyx_L1_error))
26294 __Pyx_TraceLine(997,0,__PYX_ERR(1, 997, __pyx_L1_error))
26295 __pyx_t_2 = __pyx_capsule_create(((
void *)(&__pyx_memoryview_getbuffer)), ((
char *)
"getbuffer(obj, view, flags)"));
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 997, __pyx_L1_error)
26296 __Pyx_GOTREF(__pyx_t_2);
26297 if (PyDict_SetItem((PyObject *)__pyx_memoryviewslice_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_2) < 0) __PYX_ERR(1, 997, __pyx_L1_error)
26298 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
26299 PyType_Modified(__pyx_memoryviewslice_type);
26308 __Pyx_TraceLine(1001,0,__PYX_ERR(1, 1001, __pyx_L1_error))
26318 __Pyx_TraceLine(1054,0,__PYX_ERR(1, 1054, __pyx_L1_error))
26328 __Pyx_TraceLine(1065,0,__PYX_ERR(1, 1065, __pyx_L1_error))
26338 __Pyx_TraceLine(1082,0,__PYX_ERR(1, 1082, __pyx_L1_error))
26348 __Pyx_TraceLine(1089,0,__PYX_ERR(1, 1089, __pyx_L1_error))
26358 __Pyx_TraceLine(1111,0,__PYX_ERR(1, 1111, __pyx_L1_error))
26368 __Pyx_TraceLine(1118,0,__PYX_ERR(1, 1118, __pyx_L1_error))
26378 __Pyx_TraceLine(1172,0,__PYX_ERR(1, 1172, __pyx_L1_error))
26388 __Pyx_TraceLine(1179,0,__PYX_ERR(1, 1179, __pyx_L1_error))
26398 __Pyx_TraceLine(1189,0,__PYX_ERR(1, 1189, __pyx_L1_error))
26408 __Pyx_TraceLine(1210,0,__PYX_ERR(1, 1210, __pyx_L1_error))
26418 __Pyx_TraceLine(1253,0,__PYX_ERR(1, 1253, __pyx_L1_error))
26428 __Pyx_TraceLine(1259,0,__PYX_ERR(1, 1259, __pyx_L1_error))
26438 __Pyx_TraceLine(1263,0,__PYX_ERR(1, 1263, __pyx_L1_error))
26448 __Pyx_TraceLine(1270,0,__PYX_ERR(1, 1270, __pyx_L1_error))
26458 __Pyx_TraceLine(1342,0,__PYX_ERR(1, 1342, __pyx_L1_error))
26468 __Pyx_TraceLine(1364,0,__PYX_ERR(1, 1364, __pyx_L1_error))
26478 __Pyx_TraceLine(1373,0,__PYX_ERR(1, 1373, __pyx_L1_error))
26488 __Pyx_TraceLine(1379,0,__PYX_ERR(1, 1379, __pyx_L1_error))
26498 __Pyx_TraceLine(1399,0,__PYX_ERR(1, 1399, __pyx_L1_error))
26508 __Pyx_TraceLine(1409,0,__PYX_ERR(1, 1409, __pyx_L1_error))
26516 __Pyx_TraceLine(1,0,__PYX_ERR(1, 1, __pyx_L1_error))
26517 __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_15View_dot_MemoryView_1__pyx_unpickle_Enum, NULL, __pyx_n_s_View_MemoryView);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1, __pyx_L1_error)
26518 __Pyx_GOTREF(__pyx_t_2);
26519 if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_Enum, __pyx_t_2) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
26520 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
26529 __Pyx_TraceLine(11,0,__PYX_ERR(1, 11, __pyx_L1_error))
26531 __Pyx_TraceReturn(Py_None, 0);
26537 __Pyx_XDECREF(__pyx_t_1);
26538 __Pyx_XDECREF(__pyx_t_2);
26541 __Pyx_AddTraceback(
"init imate.traceinv._hutchinson_method", __pyx_clineno, __pyx_lineno, __pyx_filename);
26544 }
else if (!PyErr_Occurred()) {
26545 PyErr_SetString(PyExc_ImportError,
"init imate.traceinv._hutchinson_method");
26548 __Pyx_RefNannyFinishContext();
26549 #if CYTHON_PEP489_MULTI_PHASE_INIT
26550 return (__pyx_m != NULL) ? 0 : -1;
26551 #elif PY_MAJOR_VERSION >= 3
26560 #if CYTHON_REFNANNY
26561 static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(
const char *modname) {
26562 PyObject *m = NULL, *p = NULL;
26564 m = PyImport_ImportModule(modname);
26566 p = PyObject_GetAttrString(m,
"RefNannyAPI");
26568 r = PyLong_AsVoidPtr(p);
26572 return (__Pyx_RefNannyAPIStruct *)r;
26577 #if CYTHON_USE_TYPE_SLOTS
26578 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
26579 PyTypeObject* tp = Py_TYPE(obj);
26580 if (likely(tp->tp_getattro))
26581 return tp->tp_getattro(obj, attr_name);
26582 #if PY_MAJOR_VERSION < 3
26583 if (likely(tp->tp_getattr))
26584 return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
26586 return PyObject_GetAttr(obj, attr_name);
26591 static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
26592 PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name);
26593 if (unlikely(!result)) {
26594 PyErr_Format(PyExc_NameError,
26595 #
if PY_MAJOR_VERSION >= 3
26596 "name '%U' is not defined", name);
26598 "name '%.200s' is not defined", PyString_AS_STRING(name));
26605 static void __Pyx_RaiseDoubleKeywordsError(
26606 const char* func_name,
26609 PyErr_Format(PyExc_TypeError,
26610 #
if PY_MAJOR_VERSION >= 3
26611 "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
26613 "%s() got multiple values for keyword argument '%s'", func_name,
26614 PyString_AsString(kw_name));
26619 static int __Pyx_ParseOptionalKeywords(
26621 PyObject **argnames[],
26623 PyObject *values[],
26624 Py_ssize_t num_pos_args,
26625 const char* function_name)
26627 PyObject *key = 0, *value = 0;
26628 Py_ssize_t pos = 0;
26630 PyObject*** first_kw_arg = argnames + num_pos_args;
26631 while (PyDict_Next(kwds, &pos, &key, &value)) {
26632 name = first_kw_arg;
26633 while (*name && (**name != key)) name++;
26635 values[name-argnames] = value;
26638 name = first_kw_arg;
26639 #if PY_MAJOR_VERSION < 3
26640 if (likely(PyString_Check(key))) {
26642 if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key))
26643 && _PyString_Eq(**name, key)) {
26644 values[name-argnames] = value;
26649 if (*name)
continue;
26651 PyObject*** argname = argnames;
26652 while (argname != first_kw_arg) {
26653 if ((**argname == key) || (
26654 (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key))
26655 && _PyString_Eq(**argname, key))) {
26656 goto arg_passed_twice;
26663 if (likely(PyUnicode_Check(key))) {
26665 int cmp = (**name == key) ? 0 :
26666 #
if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
26667 (__Pyx_PyUnicode_GET_LENGTH(**name) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 :
26669 PyUnicode_Compare(**name, key);
26670 if (cmp < 0 && unlikely(PyErr_Occurred()))
goto bad;
26672 values[name-argnames] = value;
26677 if (*name)
continue;
26679 PyObject*** argname = argnames;
26680 while (argname != first_kw_arg) {
26681 int cmp = (**argname == key) ? 0 :
26682 #
if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
26683 (__Pyx_PyUnicode_GET_LENGTH(**argname) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 :
26685 PyUnicode_Compare(**argname, key);
26686 if (cmp < 0 && unlikely(PyErr_Occurred()))
goto bad;
26687 if (cmp == 0)
goto arg_passed_twice;
26692 goto invalid_keyword_type;
26694 if (unlikely(PyDict_SetItem(kwds2, key, value)))
goto bad;
26696 goto invalid_keyword;
26701 __Pyx_RaiseDoubleKeywordsError(function_name, key);
26703 invalid_keyword_type:
26704 PyErr_Format(PyExc_TypeError,
26705 "%.200s() keywords must be strings", function_name);
26708 PyErr_Format(PyExc_TypeError,
26709 #
if PY_MAJOR_VERSION < 3
26710 "%.200s() got an unexpected keyword argument '%.200s'",
26711 function_name, PyString_AsString(key));
26713 "%s() got an unexpected keyword argument '%U'",
26714 function_name, key);
26721 static void __Pyx_RaiseArgtupleInvalid(
26722 const char* func_name,
26724 Py_ssize_t num_min,
26725 Py_ssize_t num_max,
26726 Py_ssize_t num_found)
26728 Py_ssize_t num_expected;
26729 const char *more_or_less;
26730 if (num_found < num_min) {
26731 num_expected = num_min;
26732 more_or_less =
"at least";
26734 num_expected = num_max;
26735 more_or_less =
"at most";
26738 more_or_less =
"exactly";
26740 PyErr_Format(PyExc_TypeError,
26741 "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T
"d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T
"d given)",
26742 func_name, more_or_less, num_expected,
26743 (num_expected == 1) ?
"" :
"s", num_found);
26747 #if CYTHON_FAST_THREAD_STATE
26748 static CYTHON_INLINE
void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
26749 PyObject *tmp_type, *tmp_value, *tmp_tb;
26750 tmp_type = tstate->curexc_type;
26751 tmp_value = tstate->curexc_value;
26752 tmp_tb = tstate->curexc_traceback;
26753 tstate->curexc_type = type;
26754 tstate->curexc_value = value;
26755 tstate->curexc_traceback = tb;
26756 Py_XDECREF(tmp_type);
26757 Py_XDECREF(tmp_value);
26758 Py_XDECREF(tmp_tb);
26760 static CYTHON_INLINE
void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
26761 *type = tstate->curexc_type;
26762 *value = tstate->curexc_value;
26763 *tb = tstate->curexc_traceback;
26764 tstate->curexc_type = 0;
26765 tstate->curexc_value = 0;
26766 tstate->curexc_traceback = 0;
26772 static int __Pyx_TraceSetupAndCall(PyCodeObject** code,
26773 PyFrameObject** frame,
26774 PyThreadState* tstate,
26775 const char *funcname,
26776 const char *srcfile,
26778 PyObject *type, *value, *traceback;
26780 if (*frame == NULL || !CYTHON_PROFILE_REUSE_FRAME) {
26781 if (*code == NULL) {
26782 *code = __Pyx_createFrameCodeObject(funcname, srcfile, firstlineno);
26783 if (*code == NULL)
return 0;
26785 *frame = PyFrame_New(
26791 if (*frame == NULL)
return 0;
26792 if (CYTHON_TRACE && (*frame)->f_trace == NULL) {
26793 Py_INCREF(Py_None);
26794 (*frame)->f_trace = Py_None;
26796 #if PY_VERSION_HEX < 0x030400B1
26798 (*frame)->f_tstate = tstate;
26801 __Pyx_PyFrame_SetLineNumber(*frame, firstlineno);
26803 __Pyx_EnterTracing(tstate);
26804 __Pyx_ErrFetchInState(tstate, &type, &value, &traceback);
26806 if (tstate->c_tracefunc)
26807 retval = tstate->c_tracefunc(tstate->c_traceobj, *frame, PyTrace_CALL, NULL) == 0;
26808 if (retval && tstate->c_profilefunc)
26810 retval = tstate->c_profilefunc(tstate->c_profileobj, *frame, PyTrace_CALL, NULL) == 0;
26811 __Pyx_LeaveTracing(tstate);
26813 __Pyx_ErrRestoreInState(tstate, type, value, traceback);
26814 return __Pyx_IsTracing(tstate, 0, 0) && retval;
26818 Py_XDECREF(traceback);
26822 static PyCodeObject *__Pyx_createFrameCodeObject(
const char *funcname,
const char *srcfile,
int firstlineno) {
26823 PyCodeObject *py_code = 0;
26824 #if PY_MAJOR_VERSION >= 3
26825 py_code = PyCode_NewEmpty(srcfile, funcname, firstlineno);
26826 if (likely(py_code)) {
26827 py_code->co_flags |= CO_OPTIMIZED | CO_NEWLOCALS;
26830 PyObject *py_srcfile = 0;
26831 PyObject *py_funcname = 0;
26832 py_funcname = PyString_FromString(funcname);
26833 if (unlikely(!py_funcname))
goto bad;
26834 py_srcfile = PyString_FromString(srcfile);
26835 if (unlikely(!py_srcfile))
goto bad;
26836 py_code = PyCode_New(
26840 CO_OPTIMIZED | CO_NEWLOCALS,
26853 Py_XDECREF(py_srcfile);
26854 Py_XDECREF(py_funcname);
26861 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
26862 static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) {
26863 PyObject *dict = Py_TYPE(obj)->tp_dict;
26864 return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0;
26866 static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) {
26867 PyObject **dictptr = NULL;
26868 Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset;
26870 #if CYTHON_COMPILING_IN_CPYTHON
26871 dictptr = (likely(offset > 0)) ? (PyObject **) ((
char *)obj + offset) : _PyObject_GetDictPtr(obj);
26873 dictptr = _PyObject_GetDictPtr(obj);
26876 return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0;
26878 static CYTHON_INLINE
int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) {
26879 PyObject *dict = Py_TYPE(obj)->tp_dict;
26880 if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict)))
26882 return obj_dict_version == __Pyx_get_object_dict_version(obj);
26887 #if CYTHON_USE_DICT_VERSIONS
26888 static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value)
26890 static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name)
26894 #if !CYTHON_AVOID_BORROWED_REFS
26895 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1
26896 result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash);
26897 __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
26898 if (likely(result)) {
26899 return __Pyx_NewRef(result);
26900 }
else if (unlikely(PyErr_Occurred())) {
26904 result = PyDict_GetItem(__pyx_d, name);
26905 __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
26906 if (likely(result)) {
26907 return __Pyx_NewRef(result);
26911 result = PyObject_GetItem(__pyx_d, name);
26912 __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
26913 if (likely(result)) {
26914 return __Pyx_NewRef(result);
26918 return __Pyx_GetBuiltinName(name);
26922 #if CYTHON_FAST_PYCALL
26923 static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na,
26924 PyObject *globals) {
26926 PyThreadState *tstate = __Pyx_PyThreadState_Current;
26927 PyObject **fastlocals;
26930 assert(globals != NULL);
26935 assert(tstate != NULL);
26936 f = PyFrame_New(tstate, co, globals, NULL);
26940 fastlocals = __Pyx_PyFrame_GetLocalsplus(f);
26941 for (i = 0; i < na; i++) {
26943 fastlocals[i] = *args++;
26945 result = PyEval_EvalFrameEx(f,0);
26946 ++tstate->recursion_depth;
26948 --tstate->recursion_depth;
26951 #if 1 || PY_VERSION_HEX < 0x030600B1
26952 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) {
26953 PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func);
26954 PyObject *globals = PyFunction_GET_GLOBALS(func);
26955 PyObject *argdefs = PyFunction_GET_DEFAULTS(func);
26957 #if PY_MAJOR_VERSION >= 3
26960 PyObject *kwtuple, **k;
26965 assert(kwargs == NULL || PyDict_Check(kwargs));
26966 nk = kwargs ? PyDict_Size(kwargs) : 0;
26967 if (Py_EnterRecursiveCall((
char*)
" while calling a Python object")) {
26971 #
if PY_MAJOR_VERSION >= 3
26972 co->co_kwonlyargcount == 0 &&
26974 likely(kwargs == NULL || nk == 0) &&
26975 co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) {
26976 if (argdefs == NULL && co->co_argcount == nargs) {
26977 result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals);
26980 else if (nargs == 0 && argdefs != NULL
26981 && co->co_argcount == Py_SIZE(argdefs)) {
26984 args = &PyTuple_GET_ITEM(argdefs, 0);
26985 result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals);
26989 if (kwargs != NULL) {
26991 kwtuple = PyTuple_New(2 * nk);
26992 if (kwtuple == NULL) {
26996 k = &PyTuple_GET_ITEM(kwtuple, 0);
26998 while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) {
27009 closure = PyFunction_GET_CLOSURE(func);
27010 #if PY_MAJOR_VERSION >= 3
27011 kwdefs = PyFunction_GET_KW_DEFAULTS(func);
27013 if (argdefs != NULL) {
27014 d = &PyTuple_GET_ITEM(argdefs, 0);
27015 nd = Py_SIZE(argdefs);
27021 #if PY_MAJOR_VERSION >= 3
27022 result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL,
27025 d, (
int)nd, kwdefs, closure);
27027 result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL,
27030 d, (
int)nd, closure);
27032 Py_XDECREF(kwtuple);
27034 Py_LeaveRecursiveCall();
27041 #if CYTHON_FAST_PYCCALL
27042 static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) {
27043 PyCFunctionObject *func = (PyCFunctionObject*)func_obj;
27044 PyCFunction meth = PyCFunction_GET_FUNCTION(func);
27045 PyObject *
self = PyCFunction_GET_SELF(func);
27046 int flags = PyCFunction_GET_FLAGS(func);
27047 assert(PyCFunction_Check(func));
27048 assert(METH_FASTCALL == (flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS)));
27049 assert(nargs >= 0);
27050 assert(nargs == 0 || args != NULL);
27054 assert(!PyErr_Occurred());
27055 if ((PY_VERSION_HEX < 0x030700A0) || unlikely(flags & METH_KEYWORDS)) {
27056 return (*((__Pyx_PyCFunctionFastWithKeywords)(
void*)meth)) (
self, args, nargs, NULL);
27058 return (*((__Pyx_PyCFunctionFast)(
void*)meth)) (
self, args, nargs);
27064 #if CYTHON_COMPILING_IN_CPYTHON
27065 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
27067 ternaryfunc call = Py_TYPE(func)->tp_call;
27068 if (unlikely(!call))
27069 return PyObject_Call(func, arg, kw);
27070 if (unlikely(Py_EnterRecursiveCall((
char*)
" while calling a Python object")))
27072 result = (*call)(func, arg, kw);
27073 Py_LeaveRecursiveCall();
27074 if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
27077 "NULL result without error in PyObject_Call");
27084 static CYTHON_INLINE
void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
27085 PyErr_Format(PyExc_ValueError,
27086 "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T
"d)", expected);
27090 static CYTHON_INLINE
void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
27091 PyErr_Format(PyExc_ValueError,
27092 "need more than %" CYTHON_FORMAT_SSIZE_T
"d value%.1s to unpack",
27093 index, (index == 1) ?
"" :
"s");
27097 static CYTHON_INLINE
int __Pyx_IterFinish(
void) {
27098 #if CYTHON_FAST_THREAD_STATE
27099 PyThreadState *tstate = __Pyx_PyThreadState_Current;
27100 PyObject* exc_type = tstate->curexc_type;
27101 if (unlikely(exc_type)) {
27102 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) {
27103 PyObject *exc_value, *exc_tb;
27104 exc_value = tstate->curexc_value;
27105 exc_tb = tstate->curexc_traceback;
27106 tstate->curexc_type = 0;
27107 tstate->curexc_value = 0;
27108 tstate->curexc_traceback = 0;
27109 Py_DECREF(exc_type);
27110 Py_XDECREF(exc_value);
27111 Py_XDECREF(exc_tb);
27119 if (unlikely(PyErr_Occurred())) {
27120 if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) {
27132 static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) {
27133 if (unlikely(retval)) {
27135 __Pyx_RaiseTooManyValuesError(expected);
27138 return __Pyx_IterFinish();
27142 static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
27144 if (!j)
return NULL;
27145 r = PyObject_GetItem(o, j);
27149 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
27150 CYTHON_NCP_UNUSED
int wraparound,
27151 CYTHON_NCP_UNUSED
int boundscheck) {
27152 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
27153 Py_ssize_t wrapped_i = i;
27154 if (wraparound & unlikely(i < 0)) {
27155 wrapped_i += PyList_GET_SIZE(o);
27157 if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyList_GET_SIZE(o)))) {
27158 PyObject *r = PyList_GET_ITEM(o, wrapped_i);
27162 return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
27164 return PySequence_GetItem(o, i);
27167 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
27168 CYTHON_NCP_UNUSED
int wraparound,
27169 CYTHON_NCP_UNUSED
int boundscheck) {
27170 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
27171 Py_ssize_t wrapped_i = i;
27172 if (wraparound & unlikely(i < 0)) {
27173 wrapped_i += PyTuple_GET_SIZE(o);
27175 if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyTuple_GET_SIZE(o)))) {
27176 PyObject *r = PyTuple_GET_ITEM(o, wrapped_i);
27180 return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
27182 return PySequence_GetItem(o, i);
27185 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
int is_list,
27186 CYTHON_NCP_UNUSED
int wraparound,
27187 CYTHON_NCP_UNUSED
int boundscheck) {
27188 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS
27189 if (is_list || PyList_CheckExact(o)) {
27190 Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o);
27191 if ((!boundscheck) || (likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o))))) {
27192 PyObject *r = PyList_GET_ITEM(o, n);
27197 else if (PyTuple_CheckExact(o)) {
27198 Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o);
27199 if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyTuple_GET_SIZE(o)))) {
27200 PyObject *r = PyTuple_GET_ITEM(o, n);
27205 PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
27206 if (likely(m && m->sq_item)) {
27207 if (wraparound && unlikely(i < 0) && likely(m->sq_length)) {
27208 Py_ssize_t l = m->sq_length(o);
27209 if (likely(l >= 0)) {
27212 if (!PyErr_ExceptionMatches(PyExc_OverflowError))
27217 return m->sq_item(o, i);
27221 if (is_list || PySequence_Check(o)) {
27222 return PySequence_GetItem(o, i);
27225 return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
27229 #if CYTHON_COMPILING_IN_CPYTHON
27230 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
27231 PyObject *
self, *result;
27233 cfunc = PyCFunction_GET_FUNCTION(func);
27234 self = PyCFunction_GET_SELF(func);
27235 if (unlikely(Py_EnterRecursiveCall((
char*)
" while calling a Python object")))
27237 result = cfunc(
self, arg);
27238 Py_LeaveRecursiveCall();
27239 if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
27242 "NULL result without error in PyObject_Call");
27249 #if CYTHON_COMPILING_IN_CPYTHON
27250 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) {
27251 #if CYTHON_FAST_PYCALL
27252 if (PyFunction_Check(func)) {
27253 return __Pyx_PyFunction_FastCall(func, NULL, 0);
27256 #if defined(__Pyx_CyFunction_USED) && defined(NDEBUG)
27257 if (likely(PyCFunction_Check(func) || __Pyx_CyFunction_Check(func)))
27259 if (likely(PyCFunction_Check(func)))
27262 if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) {
27263 return __Pyx_PyObject_CallMethO(func, NULL);
27266 return __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL);
27271 #if CYTHON_COMPILING_IN_CPYTHON
27272 static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) {
27274 PyObject *args = PyTuple_New(1);
27275 if (unlikely(!args))
return NULL;
27277 PyTuple_SET_ITEM(args, 0, arg);
27278 result = __Pyx_PyObject_Call(func, args, NULL);
27282 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
27283 #if CYTHON_FAST_PYCALL
27284 if (PyFunction_Check(func)) {
27285 return __Pyx_PyFunction_FastCall(func, &arg, 1);
27288 if (likely(PyCFunction_Check(func))) {
27289 if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) {
27290 return __Pyx_PyObject_CallMethO(func, arg);
27291 #if CYTHON_FAST_PYCCALL
27292 }
else if (__Pyx_PyFastCFunction_Check(func)) {
27293 return __Pyx_PyCFunction_FastCall(func, &arg, 1);
27297 return __Pyx__PyObject_CallOneArg(func, arg);
27300 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
27302 PyObject *args = PyTuple_Pack(1, arg);
27303 if (unlikely(!args))
return NULL;
27304 result = __Pyx_PyObject_Call(func, args, NULL);
27311 static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject*
function, PyObject* arg1, PyObject* arg2) {
27312 PyObject *args, *result = NULL;
27313 #if CYTHON_FAST_PYCALL
27314 if (PyFunction_Check(
function)) {
27315 PyObject *args[2] = {arg1, arg2};
27316 return __Pyx_PyFunction_FastCall(
function, args, 2);
27319 #if CYTHON_FAST_PYCCALL
27320 if (__Pyx_PyFastCFunction_Check(
function)) {
27321 PyObject *args[2] = {arg1, arg2};
27322 return __Pyx_PyCFunction_FastCall(
function, args, 2);
27325 args = PyTuple_New(2);
27326 if (unlikely(!args))
goto done;
27328 PyTuple_SET_ITEM(args, 0, arg1);
27330 PyTuple_SET_ITEM(args, 1, arg2);
27331 Py_INCREF(
function);
27332 result = __Pyx_PyObject_Call(
function, args, NULL);
27334 Py_DECREF(
function);
27340 static CYTHON_INLINE
int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2,
int equals) {
27341 #if CYTHON_COMPILING_IN_PYPY
27342 return PyObject_RichCompareBool(s1, s2, equals);
27345 return (equals == Py_EQ);
27346 }
else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) {
27347 const char *ps1, *ps2;
27348 Py_ssize_t length = PyBytes_GET_SIZE(s1);
27349 if (length != PyBytes_GET_SIZE(s2))
27350 return (equals == Py_NE);
27351 ps1 = PyBytes_AS_STRING(s1);
27352 ps2 = PyBytes_AS_STRING(s2);
27353 if (ps1[0] != ps2[0]) {
27354 return (equals == Py_NE);
27355 }
else if (length == 1) {
27356 return (equals == Py_EQ);
27359 #if CYTHON_USE_UNICODE_INTERNALS && (PY_VERSION_HEX < 0x030B0000)
27360 Py_hash_t hash1, hash2;
27361 hash1 = ((PyBytesObject*)s1)->ob_shash;
27362 hash2 = ((PyBytesObject*)s2)->ob_shash;
27363 if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
27364 return (equals == Py_NE);
27367 result = memcmp(ps1, ps2, (
size_t)length);
27368 return (equals == Py_EQ) ? (result == 0) : (result != 0);
27370 }
else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) {
27371 return (equals == Py_NE);
27372 }
else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) {
27373 return (equals == Py_NE);
27376 PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
27379 result = __Pyx_PyObject_IsTrue(py_result);
27380 Py_DECREF(py_result);
27387 #if PY_MAJOR_VERSION < 3
27388 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
27389 CYTHON_UNUSED PyObject *cause) {
27390 __Pyx_PyThreadState_declare
27392 if (!value || value == Py_None)
27396 if (!tb || tb == Py_None)
27400 if (!PyTraceBack_Check(tb)) {
27401 PyErr_SetString(PyExc_TypeError,
27402 "raise: arg 3 must be a traceback or None");
27406 if (PyType_Check(type)) {
27407 #if CYTHON_COMPILING_IN_PYPY
27409 Py_INCREF(Py_None);
27413 PyErr_NormalizeException(&type, &value, &tb);
27416 PyErr_SetString(PyExc_TypeError,
27417 "instance exception may not have a separate value");
27421 type = (PyObject*) Py_TYPE(type);
27423 if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
27424 PyErr_SetString(PyExc_TypeError,
27425 "raise: exception class must be a subclass of BaseException");
27429 __Pyx_PyThreadState_assign
27430 __Pyx_ErrRestore(type, value, tb);
27439 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
27440 PyObject* owned_instance = NULL;
27441 if (tb == Py_None) {
27443 }
else if (tb && !PyTraceBack_Check(tb)) {
27444 PyErr_SetString(PyExc_TypeError,
27445 "raise: arg 3 must be a traceback or None");
27448 if (value == Py_None)
27450 if (PyExceptionInstance_Check(type)) {
27452 PyErr_SetString(PyExc_TypeError,
27453 "instance exception may not have a separate value");
27457 type = (PyObject*) Py_TYPE(value);
27458 }
else if (PyExceptionClass_Check(type)) {
27459 PyObject *instance_class = NULL;
27460 if (value && PyExceptionInstance_Check(value)) {
27461 instance_class = (PyObject*) Py_TYPE(value);
27462 if (instance_class != type) {
27463 int is_subclass = PyObject_IsSubclass(instance_class, type);
27464 if (!is_subclass) {
27465 instance_class = NULL;
27466 }
else if (unlikely(is_subclass == -1)) {
27469 type = instance_class;
27473 if (!instance_class) {
27476 args = PyTuple_New(0);
27477 else if (PyTuple_Check(value)) {
27481 args = PyTuple_Pack(1, value);
27484 owned_instance = PyObject_Call(type, args, NULL);
27486 if (!owned_instance)
27488 value = owned_instance;
27489 if (!PyExceptionInstance_Check(value)) {
27490 PyErr_Format(PyExc_TypeError,
27491 "calling %R should have returned an instance of "
27492 "BaseException, not %R",
27493 type, Py_TYPE(value));
27498 PyErr_SetString(PyExc_TypeError,
27499 "raise: exception class must be a subclass of BaseException");
27503 PyObject *fixed_cause;
27504 if (cause == Py_None) {
27505 fixed_cause = NULL;
27506 }
else if (PyExceptionClass_Check(cause)) {
27507 fixed_cause = PyObject_CallObject(cause, NULL);
27508 if (fixed_cause == NULL)
27510 }
else if (PyExceptionInstance_Check(cause)) {
27511 fixed_cause = cause;
27512 Py_INCREF(fixed_cause);
27514 PyErr_SetString(PyExc_TypeError,
27515 "exception causes must derive from "
27519 PyException_SetCause(value, fixed_cause);
27521 PyErr_SetObject(type, value);
27523 #if CYTHON_FAST_THREAD_STATE
27524 PyThreadState *tstate = __Pyx_PyThreadState_Current;
27525 PyObject* tmp_tb = tstate->curexc_traceback;
27526 if (tb != tmp_tb) {
27528 tstate->curexc_traceback = tb;
27529 Py_XDECREF(tmp_tb);
27532 PyObject *tmp_type, *tmp_value, *tmp_tb;
27533 PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb);
27535 PyErr_Restore(tmp_type, tmp_value, tb);
27536 Py_XDECREF(tmp_tb);
27540 Py_XDECREF(owned_instance);
27546 static CYTHON_INLINE
int __Pyx_PyObject_SetSlice(PyObject* obj, PyObject* value,
27547 Py_ssize_t cstart, Py_ssize_t cstop,
27548 PyObject** _py_start, PyObject** _py_stop, PyObject** _py_slice,
27549 int has_cstart,
int has_cstop, CYTHON_UNUSED
int wraparound) {
27550 #if CYTHON_USE_TYPE_SLOTS
27551 PyMappingMethods* mp;
27552 #if PY_MAJOR_VERSION < 3
27553 PySequenceMethods* ms = Py_TYPE(obj)->tp_as_sequence;
27554 if (likely(ms && ms->sq_ass_slice)) {
27556 if (_py_start && (*_py_start != Py_None)) {
27557 cstart = __Pyx_PyIndex_AsSsize_t(*_py_start);
27558 if ((cstart == (Py_ssize_t)-1) && PyErr_Occurred())
goto bad;
27563 if (_py_stop && (*_py_stop != Py_None)) {
27564 cstop = __Pyx_PyIndex_AsSsize_t(*_py_stop);
27565 if ((cstop == (Py_ssize_t)-1) && PyErr_Occurred())
goto bad;
27567 cstop = PY_SSIZE_T_MAX;
27569 if (wraparound && unlikely((cstart < 0) | (cstop < 0)) && likely(ms->sq_length)) {
27570 Py_ssize_t l = ms->sq_length(obj);
27571 if (likely(l >= 0)) {
27574 if (cstop < 0) cstop = 0;
27578 if (cstart < 0) cstart = 0;
27581 if (!PyErr_ExceptionMatches(PyExc_OverflowError))
27586 return ms->sq_ass_slice(obj, cstart, cstop, value);
27589 mp = Py_TYPE(obj)->tp_as_mapping;
27590 if (likely(mp && mp->mp_ass_subscript))
27594 PyObject *py_slice, *py_start, *py_stop;
27596 py_slice = *_py_slice;
27598 PyObject* owned_start = NULL;
27599 PyObject* owned_stop = NULL;
27601 py_start = *_py_start;
27604 owned_start = py_start = PyInt_FromSsize_t(cstart);
27605 if (unlikely(!py_start))
goto bad;
27607 py_start = Py_None;
27610 py_stop = *_py_stop;
27613 owned_stop = py_stop = PyInt_FromSsize_t(cstop);
27614 if (unlikely(!py_stop)) {
27615 Py_XDECREF(owned_start);
27621 py_slice = PySlice_New(py_start, py_stop, Py_None);
27622 Py_XDECREF(owned_start);
27623 Py_XDECREF(owned_stop);
27624 if (unlikely(!py_slice))
goto bad;
27626 #if CYTHON_USE_TYPE_SLOTS
27627 result = mp->mp_ass_subscript(obj, py_slice, value);
27629 result = value ? PyObject_SetItem(obj, py_slice, value) : PyObject_DelItem(obj, py_slice);
27632 Py_DECREF(py_slice);
27636 PyErr_Format(PyExc_TypeError,
27637 "'%.200s' object does not support slice %.10s",
27638 Py_TYPE(obj)->tp_name, value ?
"assignment" :
"deletion");
27644 static CYTHON_INLINE PyObject* __Pyx_PyInt_EqObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED
long intval, CYTHON_UNUSED
long inplace) {
27648 #if PY_MAJOR_VERSION < 3
27649 if (likely(PyInt_CheckExact(op1))) {
27650 const long b = intval;
27651 long a = PyInt_AS_LONG(op1);
27652 if (a == b) Py_RETURN_TRUE;
else Py_RETURN_FALSE;
27655 #if CYTHON_USE_PYLONG_INTERNALS
27656 if (likely(PyLong_CheckExact(op1))) {
27658 unsigned long uintval;
27659 Py_ssize_t size = Py_SIZE(op1);
27660 const digit* digits = ((PyLongObject*)op1)->ob_digit;
27662 if (size == 0) Py_RETURN_TRUE;
else Py_RETURN_FALSE;
27663 }
else if (intval < 0) {
27672 uintval = (
unsigned long) intval;
27673 #if PyLong_SHIFT * 4 < SIZEOF_LONG*8
27674 if (uintval >> (PyLong_SHIFT * 4)) {
27675 unequal = (size != 5) || (digits[0] != (uintval & (
unsigned long) PyLong_MASK))
27676 | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (
unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (
unsigned long) PyLong_MASK)) | (digits[3] != ((uintval >> (3 * PyLong_SHIFT)) & (
unsigned long) PyLong_MASK)) | (digits[4] != ((uintval >> (4 * PyLong_SHIFT)) & (
unsigned long) PyLong_MASK));
27679 #if PyLong_SHIFT * 3 < SIZEOF_LONG*8
27680 if (uintval >> (PyLong_SHIFT * 3)) {
27681 unequal = (size != 4) || (digits[0] != (uintval & (
unsigned long) PyLong_MASK))
27682 | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (
unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (
unsigned long) PyLong_MASK)) | (digits[3] != ((uintval >> (3 * PyLong_SHIFT)) & (
unsigned long) PyLong_MASK));
27685 #if PyLong_SHIFT * 2 < SIZEOF_LONG*8
27686 if (uintval >> (PyLong_SHIFT * 2)) {
27687 unequal = (size != 3) || (digits[0] != (uintval & (
unsigned long) PyLong_MASK))
27688 | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (
unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (
unsigned long) PyLong_MASK));
27691 #if PyLong_SHIFT * 1 < SIZEOF_LONG*8
27692 if (uintval >> (PyLong_SHIFT * 1)) {
27693 unequal = (size != 2) || (digits[0] != (uintval & (
unsigned long) PyLong_MASK))
27694 | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (
unsigned long) PyLong_MASK));
27697 unequal = (size != 1) || (((
unsigned long) digits[0]) != (uintval & (
unsigned long) PyLong_MASK));
27698 if (unequal == 0) Py_RETURN_TRUE;
else Py_RETURN_FALSE;
27701 if (PyFloat_CheckExact(op1)) {
27702 const long b = intval;
27703 double a = PyFloat_AS_DOUBLE(op1);
27704 if ((
double)a == (
double)b) Py_RETURN_TRUE;
else Py_RETURN_FALSE;
27707 PyObject_RichCompare(op1, op2, Py_EQ));
27711 #if PY_VERSION_HEX < 0x03050000
27712 static PyObject* __Pyx_PyObject_CallMatrixMethod(PyObject* method, PyObject* arg) {
27713 PyObject *result = NULL;
27714 #if CYTHON_UNPACK_METHODS
27715 if (likely(PyMethod_Check(method))) {
27716 PyObject *
self = PyMethod_GET_SELF(method);
27717 if (likely(
self)) {
27719 PyObject *
function = PyMethod_GET_FUNCTION(method);
27720 #if CYTHON_FAST_PYCALL
27721 if (PyFunction_Check(
function)) {
27722 PyObject *args[2] = {
self, arg};
27723 result = __Pyx_PyFunction_FastCall(
function, args, 2);
27727 #if CYTHON_FAST_PYCCALL
27728 if (__Pyx_PyFastCFunction_Check(
function)) {
27729 PyObject *args[2] = {
self, arg};
27730 result = __Pyx_PyCFunction_FastCall(
function, args, 2);
27734 args = PyTuple_New(2);
27735 if (unlikely(!args))
goto done;
27737 PyTuple_SET_ITEM(args, 0,
self);
27739 PyTuple_SET_ITEM(args, 1, arg);
27740 Py_INCREF(
function);
27741 Py_DECREF(method); method = NULL;
27742 result = __Pyx_PyObject_Call(
function, args, NULL);
27744 Py_DECREF(
function);
27749 result = __Pyx_PyObject_CallOneArg(method, arg);
27754 #define __Pyx_TryMatrixMethod(x, y, py_method_name) {\
27755 PyObject *func = __Pyx_PyObject_GetAttrStr(x, py_method_name);\
27757 PyObject *result = __Pyx_PyObject_CallMatrixMethod(func, y);\
27758 if (result != Py_NotImplemented)\
27760 Py_DECREF(result);\
27762 if (!PyErr_ExceptionMatches(PyExc_AttributeError))\
27767 static PyObject* __Pyx__PyNumber_MatrixMultiply(PyObject* x, PyObject* y,
const char* op_name) {
27768 int right_is_subtype = PyObject_IsSubclass((PyObject*)Py_TYPE(y), (PyObject*)Py_TYPE(x));
27769 if (unlikely(right_is_subtype == -1))
27771 if (right_is_subtype) {
27772 __Pyx_TryMatrixMethod(y, x, __pyx_n_s_rmatmul)
27774 __Pyx_TryMatrixMethod(x, y, __pyx_n_s_matmul)
27775 if (!right_is_subtype) {
27776 __Pyx_TryMatrixMethod(y, x, __pyx_n_s_rmatmul)
27778 PyErr_Format(PyExc_TypeError,
27779 "unsupported operand type(s) for %.2s: '%.100s' and '%.100s'",
27781 Py_TYPE(x)->tp_name,
27782 Py_TYPE(y)->tp_name);
27785 static PyObject* __Pyx_PyNumber_InPlaceMatrixMultiply(PyObject* x, PyObject* y) {
27786 __Pyx_TryMatrixMethod(x, y, __pyx_n_s_imatmul)
27787 return __Pyx__PyNumber_MatrixMultiply(x, y,
"@=");
27789 #undef __Pyx_TryMatrixMethod
27793 #if CYTHON_USE_TYPE_SLOTS
27794 static PyObject *__Pyx_PyObject_GetIndex(PyObject *obj, PyObject* index) {
27795 PyObject *runerr = NULL;
27796 Py_ssize_t key_value;
27797 PySequenceMethods *m = Py_TYPE(obj)->tp_as_sequence;
27798 if (unlikely(!(m && m->sq_item))) {
27799 PyErr_Format(PyExc_TypeError,
"'%.200s' object is not subscriptable", Py_TYPE(obj)->tp_name);
27802 key_value = __Pyx_PyIndex_AsSsize_t(index);
27803 if (likely(key_value != -1 || !(runerr = PyErr_Occurred()))) {
27804 return __Pyx_GetItemInt_Fast(obj, key_value, 0, 1, 1);
27806 if (PyErr_GivenExceptionMatches(runerr, PyExc_OverflowError)) {
27808 PyErr_Format(PyExc_IndexError,
"cannot fit '%.200s' into an index-sized integer", Py_TYPE(index)->tp_name);
27812 static PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key) {
27813 PyMappingMethods *m = Py_TYPE(obj)->tp_as_mapping;
27814 if (likely(m && m->mp_subscript)) {
27815 return m->mp_subscript(obj, key);
27817 return __Pyx_PyObject_GetIndex(obj, key);
27822 static int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *v) {
27825 r = PyObject_SetItem(o, j, v);
27829 static CYTHON_INLINE
int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObject *v,
int is_list,
27830 CYTHON_NCP_UNUSED
int wraparound, CYTHON_NCP_UNUSED
int boundscheck) {
27831 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS
27832 if (is_list || PyList_CheckExact(o)) {
27833 Py_ssize_t n = (!wraparound) ? i : ((likely(i >= 0)) ? i : i + PyList_GET_SIZE(o));
27834 if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o)))) {
27835 PyObject* old = PyList_GET_ITEM(o, n);
27837 PyList_SET_ITEM(o, n, v);
27842 PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
27843 if (likely(m && m->sq_ass_item)) {
27844 if (wraparound && unlikely(i < 0) && likely(m->sq_length)) {
27845 Py_ssize_t l = m->sq_length(o);
27846 if (likely(l >= 0)) {
27849 if (!PyErr_ExceptionMatches(PyExc_OverflowError))
27854 return m->sq_ass_item(o, i, v);
27858 #if CYTHON_COMPILING_IN_PYPY
27859 if (is_list || (PySequence_Check(o) && !PyDict_Check(o)))
27861 if (is_list || PySequence_Check(o))
27864 return PySequence_SetItem(o, i, v);
27867 return __Pyx_SetItemInt_Generic(o, PyInt_FromSsize_t(i), v);
27872 __Pyx_init_memviewslice(
struct __pyx_memoryview_obj *memview,
27874 __Pyx_memviewslice *memviewslice,
27875 int memview_is_new_reference)
27877 __Pyx_RefNannyDeclarations
27879 Py_buffer *buf = &memview->view;
27880 __Pyx_RefNannySetupContext(
"init_memviewslice", 0);
27881 if (unlikely(memviewslice->memview || memviewslice->data)) {
27882 PyErr_SetString(PyExc_ValueError,
27883 "memviewslice is already initialized!");
27886 if (buf->strides) {
27887 for (i = 0; i < ndim; i++) {
27888 memviewslice->strides[i] = buf->strides[i];
27891 Py_ssize_t stride = buf->itemsize;
27892 for (i = ndim - 1; i >= 0; i--) {
27893 memviewslice->strides[i] = stride;
27894 stride *= buf->shape[i];
27897 for (i = 0; i < ndim; i++) {
27898 memviewslice->shape[i] = buf->shape[i];
27899 if (buf->suboffsets) {
27900 memviewslice->suboffsets[i] = buf->suboffsets[i];
27902 memviewslice->suboffsets[i] = -1;
27905 memviewslice->memview = memview;
27906 memviewslice->data = (
char *)buf->buf;
27907 if (__pyx_add_acquisition_count(memview) == 0 && !memview_is_new_reference) {
27908 Py_INCREF(memview);
27913 memviewslice->memview = 0;
27914 memviewslice->data = 0;
27917 __Pyx_RefNannyFinishContext();
27920 #ifndef Py_NO_RETURN
27921 #define Py_NO_RETURN
27923 static void __pyx_fatalerror(
const char *fmt, ...) Py_NO_RETURN {
27926 #if PY_VERSION_HEX >= 0x030A0000 || defined(HAVE_STDARG_PROTOTYPES)
27927 va_start(vargs, fmt);
27931 vsnprintf(msg, 200, fmt, vargs);
27933 Py_FatalError(msg);
27935 static CYTHON_INLINE
int
27936 __pyx_add_acquisition_count_locked(__pyx_atomic_int *acquisition_count,
27937 PyThread_type_lock lock)
27940 PyThread_acquire_lock(lock, 1);
27941 result = (*acquisition_count)++;
27942 PyThread_release_lock(lock);
27945 static CYTHON_INLINE
int
27946 __pyx_sub_acquisition_count_locked(__pyx_atomic_int *acquisition_count,
27947 PyThread_type_lock lock)
27950 PyThread_acquire_lock(lock, 1);
27951 result = (*acquisition_count)--;
27952 PyThread_release_lock(lock);
27955 static CYTHON_INLINE
void
27956 __Pyx_INC_MEMVIEW(__Pyx_memviewslice *memslice,
int have_gil,
int lineno)
27959 struct __pyx_memoryview_obj *memview = memslice->memview;
27960 if (unlikely(!memview || (PyObject *) memview == Py_None))
27962 if (unlikely(__pyx_get_slice_count(memview) < 0))
27963 __pyx_fatalerror(
"Acquisition count is %d (line %d)",
27964 __pyx_get_slice_count(memview), lineno);
27965 first_time = __pyx_add_acquisition_count(memview) == 0;
27966 if (unlikely(first_time)) {
27968 Py_INCREF((PyObject *) memview);
27970 PyGILState_STATE _gilstate = PyGILState_Ensure();
27971 Py_INCREF((PyObject *) memview);
27972 PyGILState_Release(_gilstate);
27976 static CYTHON_INLINE
void __Pyx_XDEC_MEMVIEW(__Pyx_memviewslice *memslice,
27977 int have_gil,
int lineno) {
27979 struct __pyx_memoryview_obj *memview = memslice->memview;
27980 if (unlikely(!memview || (PyObject *) memview == Py_None)) {
27981 memslice->memview = NULL;
27984 if (unlikely(__pyx_get_slice_count(memview) <= 0))
27985 __pyx_fatalerror(
"Acquisition count is %d (line %d)",
27986 __pyx_get_slice_count(memview), lineno);
27987 last_time = __pyx_sub_acquisition_count(memview) == 1;
27988 memslice->data = NULL;
27989 if (unlikely(last_time)) {
27991 Py_CLEAR(memslice->memview);
27993 PyGILState_STATE _gilstate = PyGILState_Ensure();
27994 Py_CLEAR(memslice->memview);
27995 PyGILState_Release(_gilstate);
27998 memslice->memview = NULL;
28003 static CYTHON_INLINE
void __Pyx_RaiseUnboundLocalError(
const char *varname) {
28004 PyErr_Format(PyExc_UnboundLocalError,
"local variable '%s' referenced before assignment", varname);
28008 static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type,
const char *name,
int exact)
28010 if (unlikely(!type)) {
28011 PyErr_SetString(PyExc_SystemError,
"Missing type object");
28015 #if PY_MAJOR_VERSION == 2
28016 if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj)))
return 1;
28020 if (likely(__Pyx_TypeCheck(obj, type)))
return 1;
28022 PyErr_Format(PyExc_TypeError,
28023 "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)",
28024 name, type->tp_name, Py_TYPE(obj)->tp_name);
28029 static CYTHON_INLINE
int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2,
int equals) {
28030 #if CYTHON_COMPILING_IN_PYPY
28031 return PyObject_RichCompareBool(s1, s2, equals);
28033 #if PY_MAJOR_VERSION < 3
28034 PyObject* owned_ref = NULL;
28036 int s1_is_unicode, s2_is_unicode;
28040 s1_is_unicode = PyUnicode_CheckExact(s1);
28041 s2_is_unicode = PyUnicode_CheckExact(s2);
28042 #if PY_MAJOR_VERSION < 3
28043 if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) {
28044 owned_ref = PyUnicode_FromObject(s2);
28045 if (unlikely(!owned_ref))
28049 }
else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) {
28050 owned_ref = PyUnicode_FromObject(s1);
28051 if (unlikely(!owned_ref))
28055 }
else if (((!s2_is_unicode) & (!s1_is_unicode))) {
28056 return __Pyx_PyBytes_Equals(s1, s2, equals);
28059 if (s1_is_unicode & s2_is_unicode) {
28062 void *data1, *data2;
28063 if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0))
28065 length = __Pyx_PyUnicode_GET_LENGTH(s1);
28066 if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) {
28069 #if CYTHON_USE_UNICODE_INTERNALS
28071 Py_hash_t hash1, hash2;
28072 #if CYTHON_PEP393_ENABLED
28073 hash1 = ((PyASCIIObject*)s1)->hash;
28074 hash2 = ((PyASCIIObject*)s2)->hash;
28076 hash1 = ((PyUnicodeObject*)s1)->hash;
28077 hash2 = ((PyUnicodeObject*)s2)->hash;
28079 if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
28084 kind = __Pyx_PyUnicode_KIND(s1);
28085 if (kind != __Pyx_PyUnicode_KIND(s2)) {
28088 data1 = __Pyx_PyUnicode_DATA(s1);
28089 data2 = __Pyx_PyUnicode_DATA(s2);
28090 if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) {
28092 }
else if (length == 1) {
28095 int result = memcmp(data1, data2, (
size_t)(length * kind));
28096 #if PY_MAJOR_VERSION < 3
28097 Py_XDECREF(owned_ref);
28099 return (equals == Py_EQ) ? (result == 0) : (result != 0);
28101 }
else if ((s1 == Py_None) & s2_is_unicode) {
28103 }
else if ((s2 == Py_None) & s1_is_unicode) {
28107 PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
28108 #if PY_MAJOR_VERSION < 3
28109 Py_XDECREF(owned_ref);
28113 result = __Pyx_PyObject_IsTrue(py_result);
28114 Py_DECREF(py_result);
28118 #if PY_MAJOR_VERSION < 3
28119 Py_XDECREF(owned_ref);
28121 return (equals == Py_EQ);
28123 #if PY_MAJOR_VERSION < 3
28124 Py_XDECREF(owned_ref);
28126 return (equals == Py_NE);
28131 static void __Pyx_WriteUnraisable(
const char *name, CYTHON_UNUSED
int clineno,
28132 CYTHON_UNUSED
int lineno, CYTHON_UNUSED
const char *filename,
28133 int full_traceback, CYTHON_UNUSED
int nogil) {
28134 PyObject *old_exc, *old_val, *old_tb;
28136 __Pyx_PyThreadState_declare
28138 PyGILState_STATE state;
28140 state = PyGILState_Ensure();
28141 else state = (PyGILState_STATE)0;
28143 __Pyx_PyThreadState_assign
28144 __Pyx_ErrFetch(&old_exc, &old_val, &old_tb);
28145 if (full_traceback) {
28146 Py_XINCREF(old_exc);
28147 Py_XINCREF(old_val);
28148 Py_XINCREF(old_tb);
28149 __Pyx_ErrRestore(old_exc, old_val, old_tb);
28152 #if PY_MAJOR_VERSION < 3
28153 ctx = PyString_FromString(name);
28155 ctx = PyUnicode_FromString(name);
28157 __Pyx_ErrRestore(old_exc, old_val, old_tb);
28159 PyErr_WriteUnraisable(Py_None);
28161 PyErr_WriteUnraisable(ctx);
28166 PyGILState_Release(state);
28171 static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) {
28172 #if CYTHON_USE_TYPE_SLOTS
28173 #if PY_MAJOR_VERSION >= 3
28174 if (likely(PyUnicode_Check(n)))
28176 if (likely(PyString_Check(n)))
28178 return __Pyx_PyObject_GetAttrStr(o, n);
28180 return PyObject_GetAttr(o, n);
28184 static CYTHON_INLINE PyObject* __Pyx_decode_c_string(
28185 const char* cstring, Py_ssize_t start, Py_ssize_t stop,
28186 const char* encoding,
const char* errors,
28187 PyObject* (*decode_func)(
const char *s, Py_ssize_t size,
const char *errors)) {
28189 if (unlikely((start < 0) | (stop < 0))) {
28190 size_t slen = strlen(cstring);
28191 if (unlikely(slen > (
size_t) PY_SSIZE_T_MAX)) {
28192 PyErr_SetString(PyExc_OverflowError,
28193 "c-string too long to convert to Python");
28196 length = (Py_ssize_t) slen;
28205 if (unlikely(stop <= start))
28206 return __Pyx_NewRef(__pyx_empty_unicode);
28207 length = stop - start;
28210 return decode_func(cstring, length, errors);
28212 return PyUnicode_Decode(cstring, length, encoding, errors);
28217 #if CYTHON_FAST_THREAD_STATE
28218 static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
28220 n = PyTuple_GET_SIZE(tuple);
28221 #if PY_MAJOR_VERSION >= 3
28222 for (i=0; i<n; i++) {
28223 if (exc_type == PyTuple_GET_ITEM(tuple, i))
return 1;
28226 for (i=0; i<n; i++) {
28227 if (__Pyx_PyErr_GivenExceptionMatches(exc_type, PyTuple_GET_ITEM(tuple, i)))
return 1;
28231 static CYTHON_INLINE
int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) {
28232 PyObject *exc_type = tstate->curexc_type;
28233 if (exc_type == err)
return 1;
28234 if (unlikely(!exc_type))
return 0;
28235 if (unlikely(PyTuple_Check(err)))
28236 return __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err);
28237 return __Pyx_PyErr_GivenExceptionMatches(exc_type, err);
28242 static PyObject *__Pyx_GetAttr3Default(PyObject *d) {
28243 __Pyx_PyThreadState_declare
28244 __Pyx_PyThreadState_assign
28245 if (unlikely(!__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
28247 __Pyx_PyErr_Clear();
28251 static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *n, PyObject *d) {
28252 PyObject *r = __Pyx_GetAttr(o, n);
28253 return (likely(r)) ? r : __Pyx_GetAttr3Default(d);
28257 static CYTHON_INLINE
void __Pyx_RaiseNoneNotIterableError(
void) {
28258 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not iterable");
28262 static CYTHON_INLINE
int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
28263 if (unlikely(!type)) {
28264 PyErr_SetString(PyExc_SystemError,
"Missing type object");
28267 if (likely(__Pyx_TypeCheck(obj, type)))
28269 PyErr_Format(PyExc_TypeError,
"Cannot convert %.200s to %.200s",
28270 Py_TYPE(obj)->tp_name, type->tp_name);
28275 #if CYTHON_USE_EXC_INFO_STACK
28276 static _PyErr_StackItem *
28277 __Pyx_PyErr_GetTopmostException(PyThreadState *tstate)
28279 _PyErr_StackItem *exc_info = tstate->exc_info;
28280 while ((exc_info->exc_type == NULL || exc_info->exc_type == Py_None) &&
28281 exc_info->previous_item != NULL)
28283 exc_info = exc_info->previous_item;
28290 #if CYTHON_FAST_THREAD_STATE
28291 static CYTHON_INLINE
void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
28292 #if CYTHON_USE_EXC_INFO_STACK
28293 _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate);
28294 *type = exc_info->exc_type;
28295 *value = exc_info->exc_value;
28296 *tb = exc_info->exc_traceback;
28298 *type = tstate->exc_type;
28299 *value = tstate->exc_value;
28300 *tb = tstate->exc_traceback;
28303 Py_XINCREF(*value);
28306 static CYTHON_INLINE
void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
28307 PyObject *tmp_type, *tmp_value, *tmp_tb;
28308 #if CYTHON_USE_EXC_INFO_STACK
28309 _PyErr_StackItem *exc_info = tstate->exc_info;
28310 tmp_type = exc_info->exc_type;
28311 tmp_value = exc_info->exc_value;
28312 tmp_tb = exc_info->exc_traceback;
28313 exc_info->exc_type = type;
28314 exc_info->exc_value = value;
28315 exc_info->exc_traceback = tb;
28317 tmp_type = tstate->exc_type;
28318 tmp_value = tstate->exc_value;
28319 tmp_tb = tstate->exc_traceback;
28320 tstate->exc_type = type;
28321 tstate->exc_value = value;
28322 tstate->exc_traceback = tb;
28324 Py_XDECREF(tmp_type);
28325 Py_XDECREF(tmp_value);
28326 Py_XDECREF(tmp_tb);
28331 #if CYTHON_FAST_THREAD_STATE
28332 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb)
28334 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb)
28337 PyObject *local_type, *local_value, *local_tb;
28338 #if CYTHON_FAST_THREAD_STATE
28339 PyObject *tmp_type, *tmp_value, *tmp_tb;
28340 local_type = tstate->curexc_type;
28341 local_value = tstate->curexc_value;
28342 local_tb = tstate->curexc_traceback;
28343 tstate->curexc_type = 0;
28344 tstate->curexc_value = 0;
28345 tstate->curexc_traceback = 0;
28347 PyErr_Fetch(&local_type, &local_value, &local_tb);
28349 PyErr_NormalizeException(&local_type, &local_value, &local_tb);
28350 #if CYTHON_FAST_THREAD_STATE
28351 if (unlikely(tstate->curexc_type))
28353 if (unlikely(PyErr_Occurred()))
28356 #if PY_MAJOR_VERSION >= 3
28358 if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
28362 Py_XINCREF(local_tb);
28363 Py_XINCREF(local_type);
28364 Py_XINCREF(local_value);
28365 *type = local_type;
28366 *value = local_value;
28368 #if CYTHON_FAST_THREAD_STATE
28369 #if CYTHON_USE_EXC_INFO_STACK
28371 _PyErr_StackItem *exc_info = tstate->exc_info;
28372 tmp_type = exc_info->exc_type;
28373 tmp_value = exc_info->exc_value;
28374 tmp_tb = exc_info->exc_traceback;
28375 exc_info->exc_type = local_type;
28376 exc_info->exc_value = local_value;
28377 exc_info->exc_traceback = local_tb;
28380 tmp_type = tstate->exc_type;
28381 tmp_value = tstate->exc_value;
28382 tmp_tb = tstate->exc_traceback;
28383 tstate->exc_type = local_type;
28384 tstate->exc_value = local_value;
28385 tstate->exc_traceback = local_tb;
28387 Py_XDECREF(tmp_type);
28388 Py_XDECREF(tmp_value);
28389 Py_XDECREF(tmp_tb);
28391 PyErr_SetExcInfo(local_type, local_value, local_tb);
28398 Py_XDECREF(local_type);
28399 Py_XDECREF(local_value);
28400 Py_XDECREF(local_tb);
28405 #if CYTHON_FAST_THREAD_STATE
28406 static CYTHON_INLINE
void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
28407 PyObject *tmp_type, *tmp_value, *tmp_tb;
28408 #if CYTHON_USE_EXC_INFO_STACK
28409 _PyErr_StackItem *exc_info = tstate->exc_info;
28410 tmp_type = exc_info->exc_type;
28411 tmp_value = exc_info->exc_value;
28412 tmp_tb = exc_info->exc_traceback;
28413 exc_info->exc_type = *type;
28414 exc_info->exc_value = *value;
28415 exc_info->exc_traceback = *tb;
28417 tmp_type = tstate->exc_type;
28418 tmp_value = tstate->exc_value;
28419 tmp_tb = tstate->exc_traceback;
28420 tstate->exc_type = *type;
28421 tstate->exc_value = *value;
28422 tstate->exc_traceback = *tb;
28425 *value = tmp_value;
28429 static CYTHON_INLINE
void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) {
28430 PyObject *tmp_type, *tmp_value, *tmp_tb;
28431 PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb);
28432 PyErr_SetExcInfo(*type, *value, *tb);
28434 *value = tmp_value;
28440 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list,
int level) {
28441 PyObject *empty_list = 0;
28442 PyObject *module = 0;
28443 PyObject *global_dict = 0;
28444 PyObject *empty_dict = 0;
28446 #if PY_MAJOR_VERSION < 3
28447 PyObject *py_import;
28448 py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
28455 empty_list = PyList_New(0);
28460 global_dict = PyModule_GetDict(__pyx_m);
28463 empty_dict = PyDict_New();
28467 #if PY_MAJOR_VERSION >= 3
28469 if ((1) && (strchr(__Pyx_MODULE_NAME,
'.'))) {
28470 module = PyImport_ImportModuleLevelObject(
28471 name, global_dict, empty_dict, list, 1);
28473 if (!PyErr_ExceptionMatches(PyExc_ImportError))
28482 #if PY_MAJOR_VERSION < 3
28483 PyObject *py_level = PyInt_FromLong(level);
28486 module = PyObject_CallFunctionObjArgs(py_import,
28487 name, global_dict, empty_dict, list, py_level, (PyObject *)NULL);
28488 Py_DECREF(py_level);
28490 module = PyImport_ImportModuleLevelObject(
28491 name, global_dict, empty_dict, list, level);
28496 #if PY_MAJOR_VERSION < 3
28497 Py_XDECREF(py_import);
28499 Py_XDECREF(empty_list);
28500 Py_XDECREF(empty_dict);
28505 #if CYTHON_COMPILING_IN_CPYTHON
28506 static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) {
28512 return b == &PyBaseObject_Type;
28514 static CYTHON_INLINE
int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) {
28516 if (a == b)
return 1;
28520 n = PyTuple_GET_SIZE(mro);
28521 for (i = 0; i < n; i++) {
28522 if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b)
28527 return __Pyx_InBases(a, b);
28529 #if PY_MAJOR_VERSION == 2
28530 static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) {
28531 PyObject *exception, *value, *tb;
28533 __Pyx_PyThreadState_declare
28534 __Pyx_PyThreadState_assign
28535 __Pyx_ErrFetch(&exception, &value, &tb);
28536 res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0;
28537 if (unlikely(res == -1)) {
28538 PyErr_WriteUnraisable(err);
28542 res = PyObject_IsSubclass(err, exc_type2);
28543 if (unlikely(res == -1)) {
28544 PyErr_WriteUnraisable(err);
28548 __Pyx_ErrRestore(exception, value, tb);
28552 static CYTHON_INLINE
int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) {
28553 int res = exc_type1 ? __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type1) : 0;
28555 res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2);
28560 static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
28562 assert(PyExceptionClass_Check(exc_type));
28563 n = PyTuple_GET_SIZE(tuple);
28564 #if PY_MAJOR_VERSION >= 3
28565 for (i=0; i<n; i++) {
28566 if (exc_type == PyTuple_GET_ITEM(tuple, i))
return 1;
28569 for (i=0; i<n; i++) {
28570 PyObject *t = PyTuple_GET_ITEM(tuple, i);
28571 #if PY_MAJOR_VERSION < 3
28572 if (likely(exc_type == t))
return 1;
28574 if (likely(PyExceptionClass_Check(t))) {
28575 if (__Pyx_inner_PyErr_GivenExceptionMatches2(exc_type, NULL, t))
return 1;
28581 static CYTHON_INLINE
int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject* exc_type) {
28582 if (likely(err == exc_type))
return 1;
28583 if (likely(PyExceptionClass_Check(err))) {
28584 if (likely(PyExceptionClass_Check(exc_type))) {
28585 return __Pyx_inner_PyErr_GivenExceptionMatches2(err, NULL, exc_type);
28586 }
else if (likely(PyTuple_Check(exc_type))) {
28587 return __Pyx_PyErr_GivenExceptionMatchesTuple(err, exc_type);
28591 return PyErr_GivenExceptionMatches(err, exc_type);
28593 static CYTHON_INLINE
int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *exc_type1, PyObject *exc_type2) {
28594 assert(PyExceptionClass_Check(exc_type1));
28595 assert(PyExceptionClass_Check(exc_type2));
28596 if (likely(err == exc_type1 || err == exc_type2))
return 1;
28597 if (likely(PyExceptionClass_Check(err))) {
28598 return __Pyx_inner_PyErr_GivenExceptionMatches2(err, exc_type1, exc_type2);
28600 return (PyErr_GivenExceptionMatches(err, exc_type1) || PyErr_GivenExceptionMatches(err, exc_type2));
28605 #if !CYTHON_COMPILING_IN_PYPY
28606 static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED
long intval,
int inplace,
int zerodivision_check) {
28608 (void)zerodivision_check;
28609 #if PY_MAJOR_VERSION < 3
28610 if (likely(PyInt_CheckExact(op1))) {
28611 const long b = intval;
28613 long a = PyInt_AS_LONG(op1);
28614 x = (long)((
unsigned long)a + b);
28615 if (likely((x^a) >= 0 || (x^b) >= 0))
28616 return PyInt_FromLong(x);
28617 return PyLong_Type.tp_as_number->nb_add(op1, op2);
28620 #if CYTHON_USE_PYLONG_INTERNALS
28621 if (likely(PyLong_CheckExact(op1))) {
28622 const long b = intval;
28624 #ifdef HAVE_LONG_LONG
28625 const PY_LONG_LONG llb = intval;
28626 PY_LONG_LONG lla, llx;
28628 const digit* digits = ((PyLongObject*)op1)->ob_digit;
28629 const Py_ssize_t size = Py_SIZE(op1);
28630 if (likely(__Pyx_sst_abs(size) <= 1)) {
28631 a = likely(size) ? digits[0] : 0;
28632 if (size == -1) a = -a;
28636 if (8 *
sizeof(
long) - 1 > 2 * PyLong_SHIFT) {
28637 a = -(long) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
28639 #ifdef HAVE_LONG_LONG
28640 }
else if (8 *
sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
28641 lla = -(PY_LONG_LONG) (((((
unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[0]));
28645 CYTHON_FALLTHROUGH;
28647 if (8 *
sizeof(
long) - 1 > 2 * PyLong_SHIFT) {
28648 a = (long) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
28650 #ifdef HAVE_LONG_LONG
28651 }
else if (8 *
sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
28652 lla = (PY_LONG_LONG) (((((
unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[0]));
28656 CYTHON_FALLTHROUGH;
28658 if (8 *
sizeof(
long) - 1 > 3 * PyLong_SHIFT) {
28659 a = -(long) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
28661 #ifdef HAVE_LONG_LONG
28662 }
else if (8 *
sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
28663 lla = -(PY_LONG_LONG) (((((((
unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[0]));
28667 CYTHON_FALLTHROUGH;
28669 if (8 *
sizeof(
long) - 1 > 3 * PyLong_SHIFT) {
28670 a = (long) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
28672 #ifdef HAVE_LONG_LONG
28673 }
else if (8 *
sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
28674 lla = (PY_LONG_LONG) (((((((
unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[0]));
28678 CYTHON_FALLTHROUGH;
28680 if (8 *
sizeof(
long) - 1 > 4 * PyLong_SHIFT) {
28681 a = -(long) (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
28683 #ifdef HAVE_LONG_LONG
28684 }
else if (8 *
sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
28685 lla = -(PY_LONG_LONG) (((((((((
unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[0]));
28689 CYTHON_FALLTHROUGH;
28691 if (8 *
sizeof(
long) - 1 > 4 * PyLong_SHIFT) {
28692 a = (long) (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
28694 #ifdef HAVE_LONG_LONG
28695 }
else if (8 *
sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
28696 lla = (PY_LONG_LONG) (((((((((
unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[0]));
28700 CYTHON_FALLTHROUGH;
28701 default:
return PyLong_Type.tp_as_number->nb_add(op1, op2);
28705 return PyLong_FromLong(x);
28706 #ifdef HAVE_LONG_LONG
28709 return PyLong_FromLongLong(llx);
28715 if (PyFloat_CheckExact(op1)) {
28716 const long b = intval;
28717 double a = PyFloat_AS_DOUBLE(op1);
28719 PyFPE_START_PROTECT(
"add",
return NULL)
28720 result = ((double)a) + (double)b;
28721 PyFPE_END_PROTECT(result)
28722 return PyFloat_FromDouble(result);
28724 return (inplace ? PyNumber_InPlaceAdd : PyNumber_Add)(op1, op2);
28729 static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) {
28730 PyObject* value = __Pyx_PyObject_GetAttrStr(module, name);
28731 if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) {
28732 PyErr_Format(PyExc_ImportError,
28733 #
if PY_MAJOR_VERSION < 3
28734 "cannot import name %.230s", PyString_AS_STRING(name));
28736 "cannot import name %S", name);
28743 static CYTHON_INLINE
int __Pyx_HasAttr(PyObject *o, PyObject *n) {
28745 if (unlikely(!__Pyx_PyBaseString_Check(n))) {
28746 PyErr_SetString(PyExc_TypeError,
28747 "hasattr(): attribute name must be string");
28750 r = __Pyx_GetAttr(o, n);
28751 if (unlikely(!r)) {
28761 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
28762 static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) {
28763 PyErr_Format(PyExc_AttributeError,
28764 #
if PY_MAJOR_VERSION >= 3
28765 "'%.50s' object has no attribute '%U'",
28766 tp->tp_name, attr_name);
28768 "'%.50s' object has no attribute '%.400s'",
28769 tp->tp_name, PyString_AS_STRING(attr_name));
28773 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) {
28775 PyTypeObject *tp = Py_TYPE(obj);
28776 if (unlikely(!PyString_Check(attr_name))) {
28777 return PyObject_GenericGetAttr(obj, attr_name);
28779 assert(!tp->tp_dictoffset);
28780 descr = _PyType_Lookup(tp, attr_name);
28781 if (unlikely(!descr)) {
28782 return __Pyx_RaiseGenericGetAttributeError(tp, attr_name);
28785 #if PY_MAJOR_VERSION < 3
28786 if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS)))
28789 descrgetfunc f = Py_TYPE(descr)->tp_descr_get;
28791 PyObject *res = f(descr, obj, (PyObject *)tp);
28801 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
28802 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name) {
28803 if (unlikely(Py_TYPE(obj)->tp_dictoffset)) {
28804 return PyObject_GenericGetAttr(obj, attr_name);
28806 return __Pyx_PyObject_GenericGetAttrNoDict(obj, attr_name);
28811 static int __Pyx_SetVtable(PyObject *dict,
void *vtable) {
28812 #if PY_VERSION_HEX >= 0x02070000
28813 PyObject *ob = PyCapsule_New(vtable, 0, 0);
28815 PyObject *ob = PyCObject_FromVoidPtr(vtable, 0);
28819 if (PyDict_SetItem(dict, __pyx_n_s_pyx_vtable, ob) < 0)
28829 static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(
void) {
28830 __Pyx_PyThreadState_declare
28831 __Pyx_PyThreadState_assign
28832 if (likely(__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
28833 __Pyx_PyErr_Clear();
28835 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) {
28837 #if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS && PY_VERSION_HEX >= 0x030700B1
28838 PyTypeObject* tp = Py_TYPE(obj);
28839 if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) {
28840 return _PyObject_GenericGetAttrWithDict(obj, attr_name, NULL, 1);
28843 result = __Pyx_PyObject_GetAttrStr(obj, attr_name);
28844 if (unlikely(!result)) {
28845 __Pyx_PyObject_GetAttrStr_ClearAttributeError();
28851 static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) {
28853 PyObject *name_attr;
28854 name_attr = __Pyx_PyObject_GetAttrStr(meth, __pyx_n_s_name_2);
28855 if (likely(name_attr)) {
28856 ret = PyObject_RichCompareBool(name_attr, name, Py_EQ);
28860 if (unlikely(ret < 0)) {
28864 Py_XDECREF(name_attr);
28867 static int __Pyx_setup_reduce(PyObject* type_obj) {
28869 PyObject *object_reduce = NULL;
28870 PyObject *object_getstate = NULL;
28871 PyObject *object_reduce_ex = NULL;
28872 PyObject *reduce = NULL;
28873 PyObject *reduce_ex = NULL;
28874 PyObject *reduce_cython = NULL;
28875 PyObject *setstate = NULL;
28876 PyObject *setstate_cython = NULL;
28877 PyObject *getstate = NULL;
28878 #if CYTHON_USE_PYTYPE_LOOKUP
28879 getstate = _PyType_Lookup((PyTypeObject*)type_obj, __pyx_n_s_getstate);
28881 getstate = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_getstate);
28882 if (!getstate && PyErr_Occurred()) {
28887 #if CYTHON_USE_PYTYPE_LOOKUP
28888 object_getstate = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_getstate);
28890 object_getstate = __Pyx_PyObject_GetAttrStrNoError((PyObject*)&PyBaseObject_Type, __pyx_n_s_getstate);
28891 if (!object_getstate && PyErr_Occurred()) {
28895 if (object_getstate != getstate) {
28899 #if CYTHON_USE_PYTYPE_LOOKUP
28900 object_reduce_ex = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce_ex);
if (!object_reduce_ex)
goto __PYX_BAD;
28902 object_reduce_ex = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce_ex);
if (!object_reduce_ex)
goto __PYX_BAD;
28904 reduce_ex = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_ex);
if (unlikely(!reduce_ex))
goto __PYX_BAD;
28905 if (reduce_ex == object_reduce_ex) {
28906 #if CYTHON_USE_PYTYPE_LOOKUP
28907 object_reduce = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce);
if (!object_reduce)
goto __PYX_BAD;
28909 object_reduce = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce);
if (!object_reduce)
goto __PYX_BAD;
28911 reduce = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce);
if (unlikely(!reduce))
goto __PYX_BAD;
28912 if (reduce == object_reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_n_s_reduce_cython)) {
28913 reduce_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_reduce_cython);
28914 if (likely(reduce_cython)) {
28915 ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce, reduce_cython);
if (unlikely(ret < 0))
goto __PYX_BAD;
28916 ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce_cython);
if (unlikely(ret < 0))
goto __PYX_BAD;
28917 }
else if (reduce == object_reduce || PyErr_Occurred()) {
28920 setstate = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_setstate);
28921 if (!setstate) PyErr_Clear();
28922 if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_n_s_setstate_cython)) {
28923 setstate_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_setstate_cython);
28924 if (likely(setstate_cython)) {
28925 ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate, setstate_cython);
if (unlikely(ret < 0))
goto __PYX_BAD;
28926 ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate_cython);
if (unlikely(ret < 0))
goto __PYX_BAD;
28927 }
else if (!setstate || PyErr_Occurred()) {
28931 PyType_Modified((PyTypeObject*)type_obj);
28936 if (!PyErr_Occurred())
28937 PyErr_Format(PyExc_RuntimeError,
"Unable to initialize pickling for %s", ((PyTypeObject*)type_obj)->tp_name);
28940 #if !CYTHON_USE_PYTYPE_LOOKUP
28941 Py_XDECREF(object_reduce);
28942 Py_XDECREF(object_reduce_ex);
28943 Py_XDECREF(object_getstate);
28944 Py_XDECREF(getstate);
28946 Py_XDECREF(reduce);
28947 Py_XDECREF(reduce_ex);
28948 Py_XDECREF(reduce_cython);
28949 Py_XDECREF(setstate);
28950 Py_XDECREF(setstate_cython);
28955 static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) {
28956 PyObject* fake_module;
28957 PyTypeObject* cached_type = NULL;
28958 fake_module = PyImport_AddModule((
char*)
"_cython_" CYTHON_ABI);
28959 if (!fake_module)
return NULL;
28960 Py_INCREF(fake_module);
28961 cached_type = (PyTypeObject*) PyObject_GetAttrString(fake_module, type->tp_name);
28963 if (!PyType_Check((PyObject*)cached_type)) {
28964 PyErr_Format(PyExc_TypeError,
28965 "Shared Cython type %.200s is not a type object",
28969 if (cached_type->tp_basicsize != type->tp_basicsize) {
28970 PyErr_Format(PyExc_TypeError,
28971 "Shared Cython type %.200s has the wrong size, try recompiling",
28976 if (!PyErr_ExceptionMatches(PyExc_AttributeError))
goto bad;
28978 if (PyType_Ready(type) < 0)
goto bad;
28979 if (PyObject_SetAttrString(fake_module, type->tp_name, (PyObject*) type) < 0)
28982 cached_type = type;
28985 Py_DECREF(fake_module);
28986 return cached_type;
28988 Py_XDECREF(cached_type);
28989 cached_type = NULL;
28994 #include <structmember.h>
28996 __Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, CYTHON_UNUSED
void *closure)
28998 if (unlikely(op->func_doc == NULL)) {
28999 if (op->func.m_ml->ml_doc) {
29000 #if PY_MAJOR_VERSION >= 3
29001 op->func_doc = PyUnicode_FromString(op->func.m_ml->ml_doc);
29003 op->func_doc = PyString_FromString(op->func.m_ml->ml_doc);
29005 if (unlikely(op->func_doc == NULL))
29008 Py_INCREF(Py_None);
29012 Py_INCREF(op->func_doc);
29013 return op->func_doc;
29016 __Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED
void *context)
29018 PyObject *tmp = op->func_doc;
29019 if (value == NULL) {
29023 op->func_doc = value;
29028 __Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op, CYTHON_UNUSED
void *context)
29030 if (unlikely(op->func_name == NULL)) {
29031 #if PY_MAJOR_VERSION >= 3
29032 op->func_name = PyUnicode_InternFromString(op->func.m_ml->ml_name);
29034 op->func_name = PyString_InternFromString(op->func.m_ml->ml_name);
29036 if (unlikely(op->func_name == NULL))
29039 Py_INCREF(op->func_name);
29040 return op->func_name;
29043 __Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED
void *context)
29046 #if PY_MAJOR_VERSION >= 3
29047 if (unlikely(value == NULL || !PyUnicode_Check(value)))
29049 if (unlikely(value == NULL || !PyString_Check(value)))
29052 PyErr_SetString(PyExc_TypeError,
29053 "__name__ must be set to a string object");
29056 tmp = op->func_name;
29058 op->func_name = value;
29063 __Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op, CYTHON_UNUSED
void *context)
29065 Py_INCREF(op->func_qualname);
29066 return op->func_qualname;
29069 __Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED
void *context)
29072 #if PY_MAJOR_VERSION >= 3
29073 if (unlikely(value == NULL || !PyUnicode_Check(value)))
29075 if (unlikely(value == NULL || !PyString_Check(value)))
29078 PyErr_SetString(PyExc_TypeError,
29079 "__qualname__ must be set to a string object");
29082 tmp = op->func_qualname;
29084 op->func_qualname = value;
29089 __Pyx_CyFunction_get_self(__pyx_CyFunctionObject *m, CYTHON_UNUSED
void *closure)
29092 self = m->func_closure;
29099 __Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op, CYTHON_UNUSED
void *context)
29101 if (unlikely(op->func_dict == NULL)) {
29102 op->func_dict = PyDict_New();
29103 if (unlikely(op->func_dict == NULL))
29106 Py_INCREF(op->func_dict);
29107 return op->func_dict;
29110 __Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED
void *context)
29113 if (unlikely(value == NULL)) {
29114 PyErr_SetString(PyExc_TypeError,
29115 "function's dictionary may not be deleted");
29118 if (unlikely(!PyDict_Check(value))) {
29119 PyErr_SetString(PyExc_TypeError,
29120 "setting function's dictionary to a non-dict");
29123 tmp = op->func_dict;
29125 op->func_dict = value;
29130 __Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op, CYTHON_UNUSED
void *context)
29132 Py_INCREF(op->func_globals);
29133 return op->func_globals;
29136 __Pyx_CyFunction_get_closure(CYTHON_UNUSED __pyx_CyFunctionObject *op, CYTHON_UNUSED
void *context)
29138 Py_INCREF(Py_None);
29142 __Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op, CYTHON_UNUSED
void *context)
29144 PyObject* result = (op->func_code) ? op->func_code : Py_None;
29149 __Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) {
29151 PyObject *res = op->defaults_getter((PyObject *) op);
29152 if (unlikely(!res))
29154 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
29155 op->defaults_tuple = PyTuple_GET_ITEM(res, 0);
29156 Py_INCREF(op->defaults_tuple);
29157 op->defaults_kwdict = PyTuple_GET_ITEM(res, 1);
29158 Py_INCREF(op->defaults_kwdict);
29160 op->defaults_tuple = PySequence_ITEM(res, 0);
29161 if (unlikely(!op->defaults_tuple)) result = -1;
29163 op->defaults_kwdict = PySequence_ITEM(res, 1);
29164 if (unlikely(!op->defaults_kwdict)) result = -1;
29171 __Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED
void *context) {
29175 }
else if (value != Py_None && !PyTuple_Check(value)) {
29176 PyErr_SetString(PyExc_TypeError,
29177 "__defaults__ must be set to a tuple object");
29181 tmp = op->defaults_tuple;
29182 op->defaults_tuple = value;
29187 __Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op, CYTHON_UNUSED
void *context) {
29188 PyObject* result = op->defaults_tuple;
29189 if (unlikely(!result)) {
29190 if (op->defaults_getter) {
29191 if (__Pyx_CyFunction_init_defaults(op) < 0)
return NULL;
29192 result = op->defaults_tuple;
29201 __Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED
void *context) {
29205 }
else if (value != Py_None && !PyDict_Check(value)) {
29206 PyErr_SetString(PyExc_TypeError,
29207 "__kwdefaults__ must be set to a dict object");
29211 tmp = op->defaults_kwdict;
29212 op->defaults_kwdict = value;
29217 __Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op, CYTHON_UNUSED
void *context) {
29218 PyObject* result = op->defaults_kwdict;
29219 if (unlikely(!result)) {
29220 if (op->defaults_getter) {
29221 if (__Pyx_CyFunction_init_defaults(op) < 0)
return NULL;
29222 result = op->defaults_kwdict;
29231 __Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED
void *context) {
29233 if (!value || value == Py_None) {
29235 }
else if (!PyDict_Check(value)) {
29236 PyErr_SetString(PyExc_TypeError,
29237 "__annotations__ must be set to a dict object");
29241 tmp = op->func_annotations;
29242 op->func_annotations = value;
29247 __Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op, CYTHON_UNUSED
void *context) {
29248 PyObject* result = op->func_annotations;
29249 if (unlikely(!result)) {
29250 result = PyDict_New();
29251 if (unlikely(!result))
return NULL;
29252 op->func_annotations = result;
29257 static PyGetSetDef __pyx_CyFunction_getsets[] = {
29258 {(
char *)
"func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
29259 {(
char *)
"__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
29260 {(
char *)
"func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
29261 {(
char *)
"__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
29262 {(
char *)
"__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0},
29263 {(
char *)
"__self__", (getter)__Pyx_CyFunction_get_self, 0, 0, 0},
29264 {(
char *)
"func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0},
29265 {(
char *)
"__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0},
29266 {(
char *)
"func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
29267 {(
char *)
"__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
29268 {(
char *)
"func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
29269 {(
char *)
"__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
29270 {(
char *)
"func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
29271 {(
char *)
"__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
29272 {(
char *)
"func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
29273 {(
char *)
"__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
29274 {(
char *)
"__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0},
29275 {(
char *)
"__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0},
29278 static PyMemberDef __pyx_CyFunction_members[] = {
29279 {(
char *)
"__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), PY_WRITE_RESTRICTED, 0},
29283 __Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, CYTHON_UNUSED PyObject *args)
29285 #if PY_MAJOR_VERSION >= 3
29286 Py_INCREF(m->func_qualname);
29287 return m->func_qualname;
29289 return PyString_FromString(m->func.m_ml->ml_name);
29292 static PyMethodDef __pyx_CyFunction_methods[] = {
29293 {
"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0},
29296 #if PY_VERSION_HEX < 0x030500A0
29297 #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist)
29299 #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func.m_weakreflist)
29301 static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject *op, PyMethodDef *ml,
int flags, PyObject* qualname,
29302 PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) {
29303 if (unlikely(op == NULL))
29306 __Pyx_CyFunction_weakreflist(op) = NULL;
29307 op->func.m_ml = ml;
29308 op->func.m_self = (PyObject *) op;
29309 Py_XINCREF(closure);
29310 op->func_closure = closure;
29311 Py_XINCREF(module);
29312 op->func.m_module = module;
29313 op->func_dict = NULL;
29314 op->func_name = NULL;
29315 Py_INCREF(qualname);
29316 op->func_qualname = qualname;
29317 op->func_doc = NULL;
29318 op->func_classobj = NULL;
29319 op->func_globals = globals;
29320 Py_INCREF(op->func_globals);
29322 op->func_code = code;
29323 op->defaults_pyobjects = 0;
29324 op->defaults_size = 0;
29325 op->defaults = NULL;
29326 op->defaults_tuple = NULL;
29327 op->defaults_kwdict = NULL;
29328 op->defaults_getter = NULL;
29329 op->func_annotations = NULL;
29330 return (PyObject *) op;
29333 __Pyx_CyFunction_clear(__pyx_CyFunctionObject *m)
29335 Py_CLEAR(m->func_closure);
29336 Py_CLEAR(m->func.m_module);
29337 Py_CLEAR(m->func_dict);
29338 Py_CLEAR(m->func_name);
29339 Py_CLEAR(m->func_qualname);
29340 Py_CLEAR(m->func_doc);
29341 Py_CLEAR(m->func_globals);
29342 Py_CLEAR(m->func_code);
29343 Py_CLEAR(m->func_classobj);
29344 Py_CLEAR(m->defaults_tuple);
29345 Py_CLEAR(m->defaults_kwdict);
29346 Py_CLEAR(m->func_annotations);
29348 PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m);
29350 for (i = 0; i < m->defaults_pyobjects; i++)
29351 Py_XDECREF(pydefaults[i]);
29352 PyObject_Free(m->defaults);
29353 m->defaults = NULL;
29357 static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m)
29359 if (__Pyx_CyFunction_weakreflist(m) != NULL)
29360 PyObject_ClearWeakRefs((PyObject *) m);
29361 __Pyx_CyFunction_clear(m);
29362 PyObject_GC_Del(m);
29364 static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m)
29366 PyObject_GC_UnTrack(m);
29367 __Pyx__CyFunction_dealloc(m);
29369 static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit,
void *arg)
29371 Py_VISIT(m->func_closure);
29372 Py_VISIT(m->func.m_module);
29373 Py_VISIT(m->func_dict);
29374 Py_VISIT(m->func_name);
29375 Py_VISIT(m->func_qualname);
29376 Py_VISIT(m->func_doc);
29377 Py_VISIT(m->func_globals);
29378 Py_VISIT(m->func_code);
29379 Py_VISIT(m->func_classobj);
29380 Py_VISIT(m->defaults_tuple);
29381 Py_VISIT(m->defaults_kwdict);
29383 PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m);
29385 for (i = 0; i < m->defaults_pyobjects; i++)
29386 Py_VISIT(pydefaults[i]);
29390 static PyObject *__Pyx_CyFunction_descr_get(PyObject *func, PyObject *obj, PyObject *type)
29392 #if PY_MAJOR_VERSION < 3
29393 __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
29394 if (m->flags & __Pyx_CYFUNCTION_STATICMETHOD) {
29398 if (m->flags & __Pyx_CYFUNCTION_CLASSMETHOD) {
29400 type = (PyObject *)(Py_TYPE(obj));
29401 return __Pyx_PyMethod_New(func, type, (PyObject *)(Py_TYPE(type)));
29403 if (obj == Py_None)
29406 return __Pyx_PyMethod_New(func, obj, type);
29409 __Pyx_CyFunction_repr(__pyx_CyFunctionObject *op)
29411 #if PY_MAJOR_VERSION >= 3
29412 return PyUnicode_FromFormat(
"<cyfunction %U at %p>",
29413 op->func_qualname, (
void *)op);
29415 return PyString_FromFormat(
"<cyfunction %s at %p>",
29416 PyString_AsString(op->func_qualname), (
void *)op);
29419 static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *
self, PyObject *arg, PyObject *kw) {
29420 PyCFunctionObject* f = (PyCFunctionObject*)func;
29421 PyCFunction meth = f->m_ml->ml_meth;
29423 switch (f->m_ml->ml_flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) {
29425 if (likely(kw == NULL || PyDict_Size(kw) == 0))
29426 return (*meth)(
self, arg);
29428 case METH_VARARGS | METH_KEYWORDS:
29429 return (*(PyCFunctionWithKeywords)(
void*)meth)(
self, arg, kw);
29431 if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
29432 size = PyTuple_GET_SIZE(arg);
29433 if (likely(size == 0))
29434 return (*meth)(
self, NULL);
29435 PyErr_Format(PyExc_TypeError,
29436 "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T
"d given)",
29437 f->m_ml->ml_name, size);
29442 if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
29443 size = PyTuple_GET_SIZE(arg);
29444 if (likely(size == 1)) {
29445 PyObject *result, *arg0;
29446 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
29447 arg0 = PyTuple_GET_ITEM(arg, 0);
29449 arg0 = PySequence_ITEM(arg, 0);
if (unlikely(!arg0))
return NULL;
29451 result = (*meth)(
self, arg0);
29452 #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS)
29457 PyErr_Format(PyExc_TypeError,
29458 "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T
"d given)",
29459 f->m_ml->ml_name, size);
29464 PyErr_SetString(PyExc_SystemError,
"Bad call flags in "
29465 "__Pyx_CyFunction_Call. METH_OLDARGS is no "
29466 "longer supported!");
29469 PyErr_Format(PyExc_TypeError,
"%.200s() takes no keyword arguments",
29473 static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) {
29474 return __Pyx_CyFunction_CallMethod(func, ((PyCFunctionObject*)func)->m_self, arg, kw);
29476 static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) {
29478 __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func;
29479 if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) {
29481 PyObject *new_args;
29483 argc = PyTuple_GET_SIZE(args);
29484 new_args = PyTuple_GetSlice(args, 1, argc);
29485 if (unlikely(!new_args))
29487 self = PyTuple_GetItem(args, 0);
29488 if (unlikely(!
self)) {
29489 Py_DECREF(new_args);
29490 #if PY_MAJOR_VERSION > 2
29491 PyErr_Format(PyExc_TypeError,
29492 "unbound method %.200S() needs an argument",
29493 cyfunc->func_qualname);
29495 PyErr_SetString(PyExc_TypeError,
29496 "unbound method needs an argument");
29500 result = __Pyx_CyFunction_CallMethod(func,
self, new_args, kw);
29501 Py_DECREF(new_args);
29503 result = __Pyx_CyFunction_Call(func, args, kw);
29507 static PyTypeObject __pyx_CyFunctionType_type = {
29508 PyVarObject_HEAD_INIT(0, 0)
29509 "cython_function_or_method",
29510 sizeof(__pyx_CyFunctionObject),
29512 (destructor) __Pyx_CyFunction_dealloc,
29516 #if PY_MAJOR_VERSION < 3
29521 (reprfunc) __Pyx_CyFunction_repr,
29526 __Pyx_CyFunction_CallAsMethod,
29531 Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC,
29533 (traverseproc) __Pyx_CyFunction_traverse,
29534 (inquiry) __Pyx_CyFunction_clear,
29536 #
if PY_VERSION_HEX < 0x030500A0
29537 offsetof(__pyx_CyFunctionObject, func_weakreflist),
29539 offsetof(PyCFunctionObject, m_weakreflist),
29543 __pyx_CyFunction_methods,
29544 __pyx_CyFunction_members,
29545 __pyx_CyFunction_getsets,
29548 __Pyx_CyFunction_descr_get,
29550 offsetof(__pyx_CyFunctionObject, func_dict),
29563 #if PY_VERSION_HEX >= 0x030400a1
29566 #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
29569 #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
29572 #if PY_VERSION_HEX >= 0x030C0000
29575 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
29579 static int __pyx_CyFunction_init(
void) {
29580 __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type);
29581 if (unlikely(__pyx_CyFunctionType == NULL)) {
29586 static CYTHON_INLINE
void *__Pyx_CyFunction_InitDefaults(PyObject *func,
size_t size,
int pyobjects) {
29587 __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
29588 m->defaults = PyObject_Malloc(size);
29589 if (unlikely(!m->defaults))
29590 return PyErr_NoMemory();
29591 memset(m->defaults, 0, size);
29592 m->defaults_pyobjects = pyobjects;
29593 m->defaults_size = size;
29594 return m->defaults;
29596 static CYTHON_INLINE
void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) {
29597 __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
29598 m->defaults_tuple = tuple;
29601 static CYTHON_INLINE
void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) {
29602 __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
29603 m->defaults_kwdict = dict;
29606 static CYTHON_INLINE
void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) {
29607 __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
29608 m->func_annotations = dict;
29613 static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml,
int flags, PyObject* qualname,
29614 PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) {
29615 PyObject *op = __Pyx_CyFunction_Init(
29616 PyObject_GC_New(__pyx_CyFunctionObject, __pyx_CyFunctionType),
29617 ml, flags, qualname, closure, module, globals, code
29620 PyObject_GC_Track(op);
29626 #ifndef CYTHON_CLINE_IN_TRACEBACK
29627 static int __Pyx_CLineForTraceback(CYTHON_UNUSED PyThreadState *tstate,
int c_line) {
29628 PyObject *use_cline;
29629 PyObject *ptype, *pvalue, *ptraceback;
29630 #if CYTHON_COMPILING_IN_CPYTHON
29631 PyObject **cython_runtime_dict;
29633 if (unlikely(!__pyx_cython_runtime)) {
29636 __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
29637 #if CYTHON_COMPILING_IN_CPYTHON
29638 cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime);
29639 if (likely(cython_runtime_dict)) {
29640 __PYX_PY_DICT_LOOKUP_IF_MODIFIED(
29641 use_cline, *cython_runtime_dict,
29642 __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback))
29646 PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback);
29647 if (use_cline_obj) {
29648 use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True;
29649 Py_DECREF(use_cline_obj);
29657 (void) PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False);
29659 else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) {
29662 __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
29668 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries,
int count,
int code_line) {
29669 int start = 0, mid = 0, end = count - 1;
29670 if (end >= 0 && code_line > entries[end].code_line) {
29673 while (start < end) {
29674 mid = start + (end - start) / 2;
29675 if (code_line < entries[mid].code_line) {
29677 }
else if (code_line > entries[mid].code_line) {
29683 if (code_line <= entries[mid].code_line) {
29689 static PyCodeObject *__pyx_find_code_object(
int code_line) {
29690 PyCodeObject* code_object;
29692 if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {
29695 pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
29696 if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) {
29699 code_object = __pyx_code_cache.entries[pos].code_object;
29700 Py_INCREF(code_object);
29701 return code_object;
29703 static void __pyx_insert_code_object(
int code_line, PyCodeObject* code_object) {
29705 __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
29706 if (unlikely(!code_line)) {
29709 if (unlikely(!entries)) {
29710 entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*
sizeof(__Pyx_CodeObjectCacheEntry));
29711 if (likely(entries)) {
29712 __pyx_code_cache.entries = entries;
29713 __pyx_code_cache.max_count = 64;
29714 __pyx_code_cache.count = 1;
29715 entries[0].code_line = code_line;
29716 entries[0].code_object = code_object;
29717 Py_INCREF(code_object);
29721 pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
29722 if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) {
29723 PyCodeObject* tmp = entries[pos].code_object;
29724 entries[pos].code_object = code_object;
29728 if (__pyx_code_cache.count == __pyx_code_cache.max_count) {
29729 int new_max = __pyx_code_cache.max_count + 64;
29730 entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
29731 __pyx_code_cache.entries, ((
size_t)new_max) *
sizeof(__Pyx_CodeObjectCacheEntry));
29732 if (unlikely(!entries)) {
29735 __pyx_code_cache.entries = entries;
29736 __pyx_code_cache.max_count = new_max;
29738 for (i=__pyx_code_cache.count; i>pos; i--) {
29739 entries[i] = entries[i-1];
29741 entries[pos].code_line = code_line;
29742 entries[pos].code_object = code_object;
29743 __pyx_code_cache.count++;
29744 Py_INCREF(code_object);
29748 #include "compile.h"
29749 #include "frameobject.h"
29750 #include "traceback.h"
29751 #if PY_VERSION_HEX >= 0x030b00a6
29752 #ifndef Py_BUILD_CORE
29753 #define Py_BUILD_CORE 1
29755 #include "internal/pycore_frame.h"
29757 static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
29758 const char *funcname,
int c_line,
29759 int py_line,
const char *filename) {
29760 PyCodeObject *py_code = NULL;
29761 PyObject *py_funcname = NULL;
29762 #if PY_MAJOR_VERSION < 3
29763 PyObject *py_srcfile = NULL;
29764 py_srcfile = PyString_FromString(filename);
29765 if (!py_srcfile)
goto bad;
29768 #if PY_MAJOR_VERSION < 3
29769 py_funcname = PyString_FromFormat(
"%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
29770 if (!py_funcname)
goto bad;
29772 py_funcname = PyUnicode_FromFormat(
"%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
29773 if (!py_funcname)
goto bad;
29774 funcname = PyUnicode_AsUTF8(py_funcname);
29775 if (!funcname)
goto bad;
29779 #if PY_MAJOR_VERSION < 3
29780 py_funcname = PyString_FromString(funcname);
29781 if (!py_funcname)
goto bad;
29784 #if PY_MAJOR_VERSION < 3
29785 py_code = __Pyx_PyCode_New(
29802 Py_DECREF(py_srcfile);
29804 py_code = PyCode_NewEmpty(filename, funcname, py_line);
29806 Py_XDECREF(py_funcname);
29809 Py_XDECREF(py_funcname);
29810 #if PY_MAJOR_VERSION < 3
29811 Py_XDECREF(py_srcfile);
29815 static void __Pyx_AddTraceback(
const char *funcname,
int c_line,
29816 int py_line,
const char *filename) {
29817 PyCodeObject *py_code = 0;
29818 PyFrameObject *py_frame = 0;
29819 PyThreadState *tstate = __Pyx_PyThreadState_Current;
29820 PyObject *ptype, *pvalue, *ptraceback;
29822 c_line = __Pyx_CLineForTraceback(tstate, c_line);
29824 py_code = __pyx_find_code_object(c_line ? -c_line : py_line);
29826 __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
29827 py_code = __Pyx_CreateCodeObjectForTraceback(
29828 funcname, c_line, py_line, filename);
29833 Py_XDECREF(pvalue);
29834 Py_XDECREF(ptraceback);
29837 __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
29838 __pyx_insert_code_object(c_line ? -c_line : py_line, py_code);
29840 py_frame = PyFrame_New(
29846 if (!py_frame)
goto bad;
29847 __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
29848 PyTraceBack_Here(py_frame);
29850 Py_XDECREF(py_code);
29851 Py_XDECREF(py_frame);
29854 #if PY_MAJOR_VERSION < 3
29855 static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view,
int flags) {
29856 if (PyObject_CheckBuffer(obj))
return PyObject_GetBuffer(obj, view, flags);
29857 if (__Pyx_TypeCheck(obj, __pyx_array_type))
return __pyx_array_getbuffer(obj, view, flags);
29858 if (__Pyx_TypeCheck(obj, __pyx_memoryview_type))
return __pyx_memoryview_getbuffer(obj, view, flags);
29859 PyErr_Format(PyExc_TypeError,
"'%.200s' does not have the buffer interface", Py_TYPE(obj)->tp_name);
29862 static void __Pyx_ReleaseBuffer(Py_buffer *view) {
29863 PyObject *obj = view->obj;
29865 if (PyObject_CheckBuffer(obj)) {
29866 PyBuffer_Release(view);
29878 __pyx_memviewslice_is_contig(
const __Pyx_memviewslice mvs,
char order,
int ndim)
29880 int i, index, step, start;
29881 Py_ssize_t itemsize = mvs.memview->view.itemsize;
29882 if (order ==
'F') {
29889 for (i = 0; i < ndim; i++) {
29890 index = start + step * i;
29891 if (mvs.suboffsets[index] >= 0 || mvs.strides[index] != itemsize)
29893 itemsize *= mvs.shape[index];
29900 __pyx_get_array_memory_extents(__Pyx_memviewslice *slice,
29901 void **out_start,
void **out_end,
29902 int ndim,
size_t itemsize)
29906 start = end = slice->data;
29907 for (i = 0; i < ndim; i++) {
29908 Py_ssize_t stride = slice->strides[i];
29909 Py_ssize_t extent = slice->shape[i];
29911 *out_start = *out_end = start;
29915 end += stride * (extent - 1);
29917 start += stride * (extent - 1);
29920 *out_start = start;
29921 *out_end = end + itemsize;
29924 __pyx_slices_overlap(__Pyx_memviewslice *slice1,
29925 __Pyx_memviewslice *slice2,
29926 int ndim,
size_t itemsize)
29928 void *start1, *end1, *start2, *end2;
29929 __pyx_get_array_memory_extents(slice1, &start1, &end1, ndim, itemsize);
29930 __pyx_get_array_memory_extents(slice2, &start2, &end2, ndim, itemsize);
29931 return (start1 < end2) && (start2 < end1);
29935 static CYTHON_INLINE PyObject *
29936 __pyx_capsule_create(
void *p, CYTHON_UNUSED
const char *sig)
29939 #if PY_VERSION_HEX >= 0x02070000
29940 cobj = PyCapsule_New(p, sig, NULL);
29942 cobj = PyCObject_FromVoidPtr(p, NULL);
29948 static CYTHON_INLINE
int __Pyx_Is_Little_Endian(
void)
29954 S.u32 = 0x01020304;
29955 return S.u8[0] == 4;
29959 static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx,
29960 __Pyx_BufFmt_StackElem* stack,
29961 __Pyx_TypeInfo* type) {
29962 stack[0].field = &ctx->root;
29963 stack[0].parent_offset = 0;
29964 ctx->root.type = type;
29965 ctx->root.name =
"buffer dtype";
29966 ctx->root.offset = 0;
29968 ctx->head->field = &ctx->root;
29969 ctx->fmt_offset = 0;
29970 ctx->head->parent_offset = 0;
29971 ctx->new_packmode =
'@';
29972 ctx->enc_packmode =
'@';
29973 ctx->new_count = 1;
29974 ctx->enc_count = 0;
29976 ctx->is_complex = 0;
29977 ctx->is_valid_array = 0;
29978 ctx->struct_alignment = 0;
29979 while (type->typegroup ==
'S') {
29981 ctx->head->field = type->fields;
29982 ctx->head->parent_offset = 0;
29983 type = type->fields->type;
29986 static int __Pyx_BufFmt_ParseNumber(
const char** ts) {
29988 const char* t = *ts;
29989 if (*t < '0' || *t >
'9') {
29992 count = *t++ -
'0';
29993 while (*t >=
'0' && *t <=
'9') {
29995 count += *t++ -
'0';
30001 static int __Pyx_BufFmt_ExpectNumber(
const char **ts) {
30002 int number = __Pyx_BufFmt_ParseNumber(ts);
30004 PyErr_Format(PyExc_ValueError,\
30005 "Does not understand character buffer dtype format string ('%c')", **ts);
30008 static void __Pyx_BufFmt_RaiseUnexpectedChar(
char ch) {
30009 PyErr_Format(PyExc_ValueError,
30010 "Unexpected format string character: '%c'", ch);
30012 static const char* __Pyx_BufFmt_DescribeTypeChar(
char ch,
int is_complex) {
30014 case '?':
return "'bool'";
30015 case 'c':
return "'char'";
30016 case 'b':
return "'signed char'";
30017 case 'B':
return "'unsigned char'";
30018 case 'h':
return "'short'";
30019 case 'H':
return "'unsigned short'";
30020 case 'i':
return "'int'";
30021 case 'I':
return "'unsigned int'";
30022 case 'l':
return "'long'";
30023 case 'L':
return "'unsigned long'";
30024 case 'q':
return "'long long'";
30025 case 'Q':
return "'unsigned long long'";
30026 case 'f':
return (is_complex ?
"'complex float'" :
"'float'");
30027 case 'd':
return (is_complex ?
"'complex double'" :
"'double'");
30028 case 'g':
return (is_complex ?
"'complex long double'" :
"'long double'");
30029 case 'T':
return "a struct";
30030 case 'O':
return "Python object";
30031 case 'P':
return "a pointer";
30032 case 's':
case 'p':
return "a string";
30033 case 0:
return "end";
30034 default:
return "unparseable format string";
30037 static size_t __Pyx_BufFmt_TypeCharToStandardSize(
char ch,
int is_complex) {
30039 case '?':
case 'c':
case 'b':
case 'B':
case 's':
case 'p':
return 1;
30040 case 'h':
case 'H':
return 2;
30041 case 'i':
case 'I':
case 'l':
case 'L':
return 4;
30042 case 'q':
case 'Q':
return 8;
30043 case 'f':
return (is_complex ? 8 : 4);
30044 case 'd':
return (is_complex ? 16 : 8);
30046 PyErr_SetString(PyExc_ValueError,
"Python does not define a standard format string size for long double ('g')..");
30049 case 'O':
case 'P':
return sizeof(
void*);
30051 __Pyx_BufFmt_RaiseUnexpectedChar(ch);
30055 static size_t __Pyx_BufFmt_TypeCharToNativeSize(
char ch,
int is_complex) {
30057 case '?':
case 'c':
case 'b':
case 'B':
case 's':
case 'p':
return 1;
30058 case 'h':
case 'H':
return sizeof(short);
30059 case 'i':
case 'I':
return sizeof(int);
30060 case 'l':
case 'L':
return sizeof(long);
30061 #ifdef HAVE_LONG_LONG
30062 case 'q':
case 'Q':
return sizeof(PY_LONG_LONG);
30064 case 'f':
return sizeof(float) * (is_complex ? 2 : 1);
30065 case 'd':
return sizeof(double) * (is_complex ? 2 : 1);
30066 case 'g':
return sizeof(
long double) * (is_complex ? 2 : 1);
30067 case 'O':
case 'P':
return sizeof(
void*);
30069 __Pyx_BufFmt_RaiseUnexpectedChar(ch);
30074 typedef struct {
char c;
short x; } __Pyx_st_short;
30075 typedef struct {
char c;
int x; } __Pyx_st_int;
30076 typedef struct {
char c;
long x; } __Pyx_st_long;
30077 typedef struct {
char c;
float x; } __Pyx_st_float;
30078 typedef struct {
char c;
double x; } __Pyx_st_double;
30079 typedef struct {
char c;
long double x; } __Pyx_st_longdouble;
30080 typedef struct {
char c;
void *x; } __Pyx_st_void_p;
30081 #ifdef HAVE_LONG_LONG
30082 typedef struct {
char c; PY_LONG_LONG x; } __Pyx_st_longlong;
30084 static size_t __Pyx_BufFmt_TypeCharToAlignment(
char ch, CYTHON_UNUSED
int is_complex) {
30086 case '?':
case 'c':
case 'b':
case 'B':
case 's':
case 'p':
return 1;
30087 case 'h':
case 'H':
return sizeof(__Pyx_st_short) -
sizeof(
short);
30088 case 'i':
case 'I':
return sizeof(__Pyx_st_int) -
sizeof(
int);
30089 case 'l':
case 'L':
return sizeof(__Pyx_st_long) -
sizeof(
long);
30090 #ifdef HAVE_LONG_LONG
30091 case 'q':
case 'Q':
return sizeof(__Pyx_st_longlong) -
sizeof(PY_LONG_LONG);
30093 case 'f':
return sizeof(__Pyx_st_float) -
sizeof(
float);
30094 case 'd':
return sizeof(__Pyx_st_double) -
sizeof(
double);
30095 case 'g':
return sizeof(__Pyx_st_longdouble) -
sizeof(
long double);
30096 case 'P':
case 'O':
return sizeof(__Pyx_st_void_p) -
sizeof(
void*);
30098 __Pyx_BufFmt_RaiseUnexpectedChar(ch);
30106 typedef struct {
short x;
char c; } __Pyx_pad_short;
30107 typedef struct {
int x;
char c; } __Pyx_pad_int;
30108 typedef struct {
long x;
char c; } __Pyx_pad_long;
30109 typedef struct {
float x;
char c; } __Pyx_pad_float;
30110 typedef struct {
double x;
char c; } __Pyx_pad_double;
30111 typedef struct {
long double x;
char c; } __Pyx_pad_longdouble;
30112 typedef struct {
void *x;
char c; } __Pyx_pad_void_p;
30113 #ifdef HAVE_LONG_LONG
30114 typedef struct { PY_LONG_LONG x;
char c; } __Pyx_pad_longlong;
30116 static size_t __Pyx_BufFmt_TypeCharToPadding(
char ch, CYTHON_UNUSED
int is_complex) {
30118 case '?':
case 'c':
case 'b':
case 'B':
case 's':
case 'p':
return 1;
30119 case 'h':
case 'H':
return sizeof(__Pyx_pad_short) -
sizeof(
short);
30120 case 'i':
case 'I':
return sizeof(__Pyx_pad_int) -
sizeof(
int);
30121 case 'l':
case 'L':
return sizeof(__Pyx_pad_long) -
sizeof(
long);
30122 #ifdef HAVE_LONG_LONG
30123 case 'q':
case 'Q':
return sizeof(__Pyx_pad_longlong) -
sizeof(PY_LONG_LONG);
30125 case 'f':
return sizeof(__Pyx_pad_float) -
sizeof(
float);
30126 case 'd':
return sizeof(__Pyx_pad_double) -
sizeof(
double);
30127 case 'g':
return sizeof(__Pyx_pad_longdouble) -
sizeof(
long double);
30128 case 'P':
case 'O':
return sizeof(__Pyx_pad_void_p) -
sizeof(
void*);
30130 __Pyx_BufFmt_RaiseUnexpectedChar(ch);
30134 static char __Pyx_BufFmt_TypeCharToGroup(
char ch,
int is_complex) {
30138 case 'b':
case 'h':
case 'i':
30139 case 'l':
case 'q':
case 's':
case 'p':
30141 case '?':
case 'B':
case 'H':
case 'I':
case 'L':
case 'Q':
30143 case 'f':
case 'd':
case 'g':
30144 return (is_complex ?
'C' :
'R');
30150 __Pyx_BufFmt_RaiseUnexpectedChar(ch);
30155 static void __Pyx_BufFmt_RaiseExpected(__Pyx_BufFmt_Context* ctx) {
30156 if (ctx->head == NULL || ctx->head->field == &ctx->root) {
30157 const char* expected;
30159 if (ctx->head == NULL) {
30163 expected = ctx->head->field->type->name;
30166 PyErr_Format(PyExc_ValueError,
30167 "Buffer dtype mismatch, expected %s%s%s but got %s",
30168 quote, expected, quote,
30169 __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex));
30171 __Pyx_StructField* field = ctx->head->field;
30172 __Pyx_StructField* parent = (ctx->head - 1)->field;
30173 PyErr_Format(PyExc_ValueError,
30174 "Buffer dtype mismatch, expected '%s' but got %s in '%s.%s'",
30175 field->type->name, __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex),
30176 parent->type->name, field->name);
30179 static int __Pyx_BufFmt_ProcessTypeChunk(__Pyx_BufFmt_Context* ctx) {
30181 size_t size, offset, arraysize = 1;
30182 if (ctx->enc_type == 0)
return 0;
30183 if (ctx->head->field->type->arraysize[0]) {
30185 if (ctx->enc_type ==
's' || ctx->enc_type ==
'p') {
30186 ctx->is_valid_array = ctx->head->field->type->ndim == 1;
30188 if (ctx->enc_count != ctx->head->field->type->arraysize[0]) {
30189 PyErr_Format(PyExc_ValueError,
30190 "Expected a dimension of size %zu, got %zu",
30191 ctx->head->field->type->arraysize[0], ctx->enc_count);
30195 if (!ctx->is_valid_array) {
30196 PyErr_Format(PyExc_ValueError,
"Expected %d dimensions, got %d",
30197 ctx->head->field->type->ndim, ndim);
30200 for (i = 0; i < ctx->head->field->type->ndim; i++) {
30201 arraysize *= ctx->head->field->type->arraysize[i];
30203 ctx->is_valid_array = 0;
30204 ctx->enc_count = 1;
30206 group = __Pyx_BufFmt_TypeCharToGroup(ctx->enc_type, ctx->is_complex);
30208 __Pyx_StructField* field = ctx->head->field;
30209 __Pyx_TypeInfo* type = field->type;
30210 if (ctx->enc_packmode ==
'@' || ctx->enc_packmode ==
'^') {
30211 size = __Pyx_BufFmt_TypeCharToNativeSize(ctx->enc_type, ctx->is_complex);
30213 size = __Pyx_BufFmt_TypeCharToStandardSize(ctx->enc_type, ctx->is_complex);
30215 if (ctx->enc_packmode ==
'@') {
30216 size_t align_at = __Pyx_BufFmt_TypeCharToAlignment(ctx->enc_type, ctx->is_complex);
30217 size_t align_mod_offset;
30218 if (align_at == 0)
return -1;
30219 align_mod_offset = ctx->fmt_offset % align_at;
30220 if (align_mod_offset > 0) ctx->fmt_offset += align_at - align_mod_offset;
30221 if (ctx->struct_alignment == 0)
30222 ctx->struct_alignment = __Pyx_BufFmt_TypeCharToPadding(ctx->enc_type,
30225 if (type->size != size || type->typegroup != group) {
30226 if (type->typegroup ==
'C' && type->fields != NULL) {
30227 size_t parent_offset = ctx->head->parent_offset + field->offset;
30229 ctx->head->field = type->fields;
30230 ctx->head->parent_offset = parent_offset;
30233 if ((type->typegroup ==
'H' || group ==
'H') && type->size == size) {
30235 __Pyx_BufFmt_RaiseExpected(ctx);
30239 offset = ctx->head->parent_offset + field->offset;
30240 if (ctx->fmt_offset != offset) {
30241 PyErr_Format(PyExc_ValueError,
30242 "Buffer dtype mismatch; next field is at offset %" CYTHON_FORMAT_SSIZE_T
"d but %" CYTHON_FORMAT_SSIZE_T
"d expected",
30243 (Py_ssize_t)ctx->fmt_offset, (Py_ssize_t)offset);
30246 ctx->fmt_offset += size;
30248 ctx->fmt_offset += (arraysize - 1) * size;
30251 if (field == &ctx->root) {
30253 if (ctx->enc_count != 0) {
30254 __Pyx_BufFmt_RaiseExpected(ctx);
30259 ctx->head->field = ++field;
30260 if (field->type == NULL) {
30262 field = ctx->head->field;
30264 }
else if (field->type->typegroup ==
'S') {
30265 size_t parent_offset = ctx->head->parent_offset + field->offset;
30266 if (field->type->fields->type == NULL)
continue;
30267 field = field->type->fields;
30269 ctx->head->field = field;
30270 ctx->head->parent_offset = parent_offset;
30276 }
while (ctx->enc_count);
30278 ctx->is_complex = 0;
30282 __pyx_buffmt_parse_array(__Pyx_BufFmt_Context* ctx,
const char** tsp)
30284 const char *ts = *tsp;
30285 int i = 0, number, ndim;
30287 if (ctx->new_count != 1) {
30288 PyErr_SetString(PyExc_ValueError,
30289 "Cannot handle repeated arrays in format string");
30292 if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1)
return NULL;
30293 ndim = ctx->head->field->type->ndim;
30294 while (*ts && *ts !=
')') {
30296 case ' ':
case '\f':
case '\r':
case '\n':
case '\t':
case '\v':
continue;
30299 number = __Pyx_BufFmt_ExpectNumber(&ts);
30300 if (number == -1)
return NULL;
30301 if (i < ndim && (
size_t) number != ctx->head->field->type->arraysize[i])
30302 return PyErr_Format(PyExc_ValueError,
30303 "Expected a dimension of size %zu, got %d",
30304 ctx->head->field->type->arraysize[i], number);
30305 if (*ts !=
',' && *ts !=
')')
30306 return PyErr_Format(PyExc_ValueError,
30307 "Expected a comma in format string, got '%c'", *ts);
30308 if (*ts ==
',') ts++;
30312 return PyErr_Format(PyExc_ValueError,
"Expected %d dimension(s), got %d",
30313 ctx->head->field->type->ndim, i);
30315 PyErr_SetString(PyExc_ValueError,
30316 "Unexpected end of format string, expected ')'");
30319 ctx->is_valid_array = 1;
30320 ctx->new_count = 1;
30324 static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx,
const char* ts) {
30329 if (ctx->enc_type != 0 && ctx->head == NULL) {
30330 __Pyx_BufFmt_RaiseExpected(ctx);
30333 if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1)
return NULL;
30334 if (ctx->head != NULL) {
30335 __Pyx_BufFmt_RaiseExpected(ctx);
30345 if (!__Pyx_Is_Little_Endian()) {
30346 PyErr_SetString(PyExc_ValueError,
"Little-endian buffer not supported on big-endian compiler");
30349 ctx->new_packmode =
'=';
30354 if (__Pyx_Is_Little_Endian()) {
30355 PyErr_SetString(PyExc_ValueError,
"Big-endian buffer not supported on little-endian compiler");
30358 ctx->new_packmode =
'=';
30364 ctx->new_packmode = *ts++;
30368 const char* ts_after_sub;
30369 size_t i, struct_count = ctx->new_count;
30370 size_t struct_alignment = ctx->struct_alignment;
30371 ctx->new_count = 1;
30374 PyErr_SetString(PyExc_ValueError,
"Buffer acquisition: Expected '{' after 'T'");
30377 if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1)
return NULL;
30379 ctx->enc_count = 0;
30380 ctx->struct_alignment = 0;
30383 for (i = 0; i != struct_count; ++i) {
30384 ts_after_sub = __Pyx_BufFmt_CheckString(ctx, ts);
30385 if (!ts_after_sub)
return NULL;
30388 if (struct_alignment) ctx->struct_alignment = struct_alignment;
30393 size_t alignment = ctx->struct_alignment;
30395 if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1)
return NULL;
30397 if (alignment && ctx->fmt_offset % alignment) {
30398 ctx->fmt_offset += alignment - (ctx->fmt_offset % alignment);
30403 if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1)
return NULL;
30404 ctx->fmt_offset += ctx->new_count;
30405 ctx->new_count = 1;
30406 ctx->enc_count = 0;
30408 ctx->enc_packmode = ctx->new_packmode;
30414 if (*ts !=
'f' && *ts !=
'd' && *ts !=
'g') {
30415 __Pyx_BufFmt_RaiseUnexpectedChar(
'Z');
30418 CYTHON_FALLTHROUGH;
30419 case '?':
case 'c':
case 'b':
case 'B':
case 'h':
case 'H':
case 'i':
case 'I':
30420 case 'l':
case 'L':
case 'q':
case 'Q':
30421 case 'f':
case 'd':
case 'g':
30422 case 'O':
case 'p':
30423 if ((ctx->enc_type == *ts) && (got_Z == ctx->is_complex) &&
30424 (ctx->enc_packmode == ctx->new_packmode) && (!ctx->is_valid_array)) {
30425 ctx->enc_count += ctx->new_count;
30426 ctx->new_count = 1;
30431 CYTHON_FALLTHROUGH;
30433 if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1)
return NULL;
30434 ctx->enc_count = ctx->new_count;
30435 ctx->enc_packmode = ctx->new_packmode;
30436 ctx->enc_type = *ts;
30437 ctx->is_complex = got_Z;
30439 ctx->new_count = 1;
30444 while(*ts !=
':') ++ts;
30448 if (!__pyx_buffmt_parse_array(ctx, &ts))
return NULL;
30452 int number = __Pyx_BufFmt_ExpectNumber(&ts);
30453 if (number == -1)
return NULL;
30454 ctx->new_count = (size_t)number;
30462 __pyx_typeinfo_cmp(__Pyx_TypeInfo *a, __Pyx_TypeInfo *b)
30469 if (a->size != b->size || a->typegroup != b->typegroup ||
30470 a->is_unsigned != b->is_unsigned || a->ndim != b->ndim) {
30471 if (a->typegroup ==
'H' || b->typegroup ==
'H') {
30472 return a->size == b->size;
30478 for (i = 0; i < a->ndim; i++)
30479 if (a->arraysize[i] != b->arraysize[i])
30482 if (a->typegroup ==
'S') {
30483 if (a->flags != b->flags)
30485 if (a->fields || b->fields) {
30486 if (!(a->fields && b->fields))
30488 for (i = 0; a->fields[i].type && b->fields[i].type; i++) {
30489 __Pyx_StructField *field_a = a->fields + i;
30490 __Pyx_StructField *field_b = b->fields + i;
30491 if (field_a->offset != field_b->offset ||
30492 !__pyx_typeinfo_cmp(field_a->type, field_b->type))
30495 return !a->fields[i].type && !b->fields[i].type;
30503 __pyx_check_strides(Py_buffer *buf,
int dim,
int ndim,
int spec)
30505 if (buf->shape[dim] <= 1)
30507 if (buf->strides) {
30508 if (spec & __Pyx_MEMVIEW_CONTIG) {
30509 if (spec & (__Pyx_MEMVIEW_PTR|__Pyx_MEMVIEW_FULL)) {
30510 if (unlikely(buf->strides[dim] !=
sizeof(
void *))) {
30511 PyErr_Format(PyExc_ValueError,
30512 "Buffer is not indirectly contiguous "
30513 "in dimension %d.", dim);
30516 }
else if (unlikely(buf->strides[dim] != buf->itemsize)) {
30517 PyErr_SetString(PyExc_ValueError,
30518 "Buffer and memoryview are not contiguous "
30519 "in the same dimension.");
30523 if (spec & __Pyx_MEMVIEW_FOLLOW) {
30524 Py_ssize_t stride = buf->strides[dim];
30527 if (unlikely(stride < buf->itemsize)) {
30528 PyErr_SetString(PyExc_ValueError,
30529 "Buffer and memoryview are not contiguous "
30530 "in the same dimension.");
30535 if (unlikely(spec & __Pyx_MEMVIEW_CONTIG && dim != ndim - 1)) {
30536 PyErr_Format(PyExc_ValueError,
30537 "C-contiguous buffer is not contiguous in "
30538 "dimension %d", dim);
30540 }
else if (unlikely(spec & (__Pyx_MEMVIEW_PTR))) {
30541 PyErr_Format(PyExc_ValueError,
30542 "C-contiguous buffer is not indirect in "
30543 "dimension %d", dim);
30545 }
else if (unlikely(buf->suboffsets)) {
30546 PyErr_SetString(PyExc_ValueError,
30547 "Buffer exposes suboffsets but no strides");
30556 __pyx_check_suboffsets(Py_buffer *buf,
int dim, CYTHON_UNUSED
int ndim,
int spec)
30558 if (spec & __Pyx_MEMVIEW_DIRECT) {
30559 if (unlikely(buf->suboffsets && buf->suboffsets[dim] >= 0)) {
30560 PyErr_Format(PyExc_ValueError,
30561 "Buffer not compatible with direct access "
30562 "in dimension %d.", dim);
30566 if (spec & __Pyx_MEMVIEW_PTR) {
30567 if (unlikely(!buf->suboffsets || (buf->suboffsets[dim] < 0))) {
30568 PyErr_Format(PyExc_ValueError,
30569 "Buffer is not indirectly accessible "
30570 "in dimension %d.", dim);
30579 __pyx_verify_contig(Py_buffer *buf,
int ndim,
int c_or_f_flag)
30582 if (c_or_f_flag & __Pyx_IS_F_CONTIG) {
30583 Py_ssize_t stride = 1;
30584 for (i = 0; i < ndim; i++) {
30585 if (unlikely(stride * buf->itemsize != buf->strides[i] && buf->shape[i] > 1)) {
30586 PyErr_SetString(PyExc_ValueError,
30587 "Buffer not fortran contiguous.");
30590 stride = stride * buf->shape[i];
30592 }
else if (c_or_f_flag & __Pyx_IS_C_CONTIG) {
30593 Py_ssize_t stride = 1;
30594 for (i = ndim - 1; i >- 1; i--) {
30595 if (unlikely(stride * buf->itemsize != buf->strides[i] && buf->shape[i] > 1)) {
30596 PyErr_SetString(PyExc_ValueError,
30597 "Buffer not C contiguous.");
30600 stride = stride * buf->shape[i];
30607 static int __Pyx_ValidateAndInit_memviewslice(
30612 __Pyx_TypeInfo *dtype,
30613 __Pyx_BufFmt_StackElem stack[],
30614 __Pyx_memviewslice *memviewslice,
30615 PyObject *original_obj)
30617 struct __pyx_memoryview_obj *memview, *new_memview;
30618 __Pyx_RefNannyDeclarations
30620 int i, spec = 0, retval = -1;
30621 __Pyx_BufFmt_Context ctx;
30622 int from_memoryview = __pyx_memoryview_check(original_obj);
30623 __Pyx_RefNannySetupContext(
"ValidateAndInit_memviewslice", 0);
30624 if (from_memoryview && __pyx_typeinfo_cmp(dtype, ((
struct __pyx_memoryview_obj *)
30625 original_obj)->typeinfo)) {
30626 memview = (
struct __pyx_memoryview_obj *) original_obj;
30627 new_memview = NULL;
30629 memview = (
struct __pyx_memoryview_obj *) __pyx_memoryview_new(
30630 original_obj, buf_flags, 0, dtype);
30631 new_memview = memview;
30632 if (unlikely(!memview))
30635 buf = &memview->view;
30636 if (unlikely(buf->ndim != ndim)) {
30637 PyErr_Format(PyExc_ValueError,
30638 "Buffer has wrong number of dimensions (expected %d, got %d)",
30643 __Pyx_BufFmt_Init(&ctx, stack, dtype);
30644 if (unlikely(!__Pyx_BufFmt_CheckString(&ctx, buf->format)))
goto fail;
30646 if (unlikely((
unsigned) buf->itemsize != dtype->size)) {
30647 PyErr_Format(PyExc_ValueError,
30648 "Item size of buffer (%" CYTHON_FORMAT_SSIZE_T
"u byte%s) "
30649 "does not match size of '%s' (%" CYTHON_FORMAT_SSIZE_T
"u byte%s)",
30651 (buf->itemsize > 1) ?
"s" :
"",
30654 (dtype->size > 1) ?
"s" :
"");
30657 if (buf->len > 0) {
30658 for (i = 0; i < ndim; i++) {
30659 spec = axes_specs[i];
30660 if (unlikely(!__pyx_check_strides(buf, i, ndim, spec)))
30662 if (unlikely(!__pyx_check_suboffsets(buf, i, ndim, spec)))
30665 if (unlikely(buf->strides && !__pyx_verify_contig(buf, ndim, c_or_f_flag)))
30668 if (unlikely(__Pyx_init_memviewslice(memview, ndim, memviewslice,
30669 new_memview != NULL) == -1)) {
30675 Py_XDECREF(new_memview);
30678 __Pyx_RefNannyFinishContext();
30683 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dcd__float(PyObject *obj,
int writable_flag) {
30684 __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
30685 __Pyx_BufFmt_StackElem stack[1];
30686 int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_CONTIG), (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_FOLLOW) };
30688 if (obj == Py_None) {
30689 result.memview = (
struct __pyx_memoryview_obj *) Py_None;
30692 retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, __Pyx_IS_F_CONTIG,
30693 (PyBUF_F_CONTIGUOUS | PyBUF_FORMAT) | writable_flag, 2,
30694 &__Pyx_TypeInfo_float, stack,
30696 if (unlikely(retcode == -1))
30700 result.memview = NULL;
30701 result.data = NULL;
30706 #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
30707 __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)
30708 #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\
30709 __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)
30710 #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\
30712 func_type value = func_value;\
30713 if (sizeof(target_type) < sizeof(func_type)) {\
30714 if (unlikely(value != (func_type) (target_type) value)) {\
30715 func_type zero = 0;\
30716 if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\
30717 return (target_type) -1;\
30718 if (is_unsigned && unlikely(value < zero))\
30719 goto raise_neg_overflow;\
30721 goto raise_overflow;\
30724 return (target_type) value;\
30728 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dcd__double(PyObject *obj,
int writable_flag) {
30729 __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
30730 __Pyx_BufFmt_StackElem stack[1];
30731 int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_CONTIG), (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_FOLLOW) };
30733 if (obj == Py_None) {
30734 result.memview = (
struct __pyx_memoryview_obj *) Py_None;
30737 retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, __Pyx_IS_F_CONTIG,
30738 (PyBUF_F_CONTIGUOUS | PyBUF_FORMAT) | writable_flag, 2,
30739 &__Pyx_TypeInfo_double, stack,
30741 if (unlikely(retcode == -1))
30745 result.memview = NULL;
30746 result.data = NULL;
30751 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_float(PyObject *obj,
int writable_flag) {
30752 __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
30753 __Pyx_BufFmt_StackElem stack[1];
30754 int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) };
30756 if (obj == Py_None) {
30757 result.memview = (
struct __pyx_memoryview_obj *) Py_None;
30760 retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0,
30761 PyBUF_RECORDS_RO | writable_flag, 1,
30762 &__Pyx_TypeInfo_float, stack,
30764 if (unlikely(retcode == -1))
30768 result.memview = NULL;
30769 result.data = NULL;
30774 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_double(PyObject *obj,
int writable_flag) {
30775 __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
30776 __Pyx_BufFmt_StackElem stack[1];
30777 int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) };
30779 if (obj == Py_None) {
30780 result.memview = (
struct __pyx_memoryview_obj *) Py_None;
30783 retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0,
30784 PyBUF_RECORDS_RO | writable_flag, 1,
30785 &__Pyx_TypeInfo_double, stack,
30787 if (unlikely(retcode == -1))
30791 result.memview = NULL;
30792 result.data = NULL;
30797 static __Pyx_memviewslice
30798 __pyx_memoryview_copy_new_contig(
const __Pyx_memviewslice *from_mvs,
30799 const char *mode,
int ndim,
30800 size_t sizeof_dtype,
int contig_flag,
30801 int dtype_is_object)
30803 __Pyx_RefNannyDeclarations
30805 __Pyx_memviewslice new_mvs = { 0, 0, { 0 }, { 0 }, { 0 } };
30806 struct __pyx_memoryview_obj *from_memview = from_mvs->memview;
30807 Py_buffer *buf = &from_memview->view;
30808 PyObject *shape_tuple = NULL;
30809 PyObject *temp_int = NULL;
30810 struct __pyx_array_obj *array_obj = NULL;
30811 struct __pyx_memoryview_obj *memview_obj = NULL;
30812 __Pyx_RefNannySetupContext(
"__pyx_memoryview_copy_new_contig", 0);
30813 for (i = 0; i < ndim; i++) {
30814 if (unlikely(from_mvs->suboffsets[i] >= 0)) {
30815 PyErr_Format(PyExc_ValueError,
"Cannot copy memoryview slice with "
30816 "indirect dimensions (axis %d)", i);
30820 shape_tuple = PyTuple_New(ndim);
30821 if (unlikely(!shape_tuple)) {
30824 __Pyx_GOTREF(shape_tuple);
30825 for(i = 0; i < ndim; i++) {
30826 temp_int = PyInt_FromSsize_t(from_mvs->shape[i]);
30827 if(unlikely(!temp_int)) {
30830 PyTuple_SET_ITEM(shape_tuple, i, temp_int);
30834 array_obj = __pyx_array_new(shape_tuple, sizeof_dtype, buf->format, (
char *) mode, NULL);
30835 if (unlikely(!array_obj)) {
30838 __Pyx_GOTREF(array_obj);
30839 memview_obj = (
struct __pyx_memoryview_obj *) __pyx_memoryview_new(
30840 (PyObject *) array_obj, contig_flag,
30842 from_mvs->memview->typeinfo);
30843 if (unlikely(!memview_obj))
30845 if (unlikely(__Pyx_init_memviewslice(memview_obj, ndim, &new_mvs, 1) < 0))
30847 if (unlikely(__pyx_memoryview_copy_contents(*from_mvs, new_mvs, ndim, ndim,
30848 dtype_is_object) < 0))
30852 __Pyx_XDECREF(new_mvs.memview);
30853 new_mvs.memview = NULL;
30854 new_mvs.data = NULL;
30856 __Pyx_XDECREF(shape_tuple);
30857 __Pyx_XDECREF(temp_int);
30858 __Pyx_XDECREF(array_obj);
30859 __Pyx_RefNannyFinishContext();
30864 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(
long value) {
30865 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
30866 #pragma GCC diagnostic push
30867 #pragma GCC diagnostic ignored "-Wconversion"
30869 const long neg_one = (long) -1, const_zero = (
long) 0;
30870 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
30871 #pragma GCC diagnostic pop
30873 const int is_unsigned = neg_one > const_zero;
30875 if (
sizeof(
long) <
sizeof(long)) {
30876 return PyInt_FromLong((
long) value);
30877 }
else if (
sizeof(
long) <=
sizeof(
unsigned long)) {
30878 return PyLong_FromUnsignedLong((
unsigned long) value);
30879 #ifdef HAVE_LONG_LONG
30880 }
else if (
sizeof(
long) <=
sizeof(
unsigned PY_LONG_LONG)) {
30881 return PyLong_FromUnsignedLongLong((
unsigned PY_LONG_LONG) value);
30885 if (
sizeof(
long) <=
sizeof(
long)) {
30886 return PyInt_FromLong((
long) value);
30887 #ifdef HAVE_LONG_LONG
30888 }
else if (
sizeof(
long) <=
sizeof(PY_LONG_LONG)) {
30889 return PyLong_FromLongLong((PY_LONG_LONG) value);
30894 int one = 1;
int little = (int)*(
unsigned char *)&one;
30895 unsigned char *bytes = (
unsigned char *)&value;
30896 return _PyLong_FromByteArray(bytes,
sizeof(
long),
30897 little, !is_unsigned);
30902 static CYTHON_INLINE
int __Pyx_PyInt_As_int(PyObject *x) {
30903 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
30904 #pragma GCC diagnostic push
30905 #pragma GCC diagnostic ignored "-Wconversion"
30907 const int neg_one = (int) -1, const_zero = (
int) 0;
30908 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
30909 #pragma GCC diagnostic pop
30911 const int is_unsigned = neg_one > const_zero;
30912 #if PY_MAJOR_VERSION < 3
30913 if (likely(PyInt_Check(x))) {
30914 if (
sizeof(
int) <
sizeof(long)) {
30915 __PYX_VERIFY_RETURN_INT(
int,
long, PyInt_AS_LONG(x))
30917 long val = PyInt_AS_LONG(x);
30918 if (is_unsigned && unlikely(val < 0)) {
30919 goto raise_neg_overflow;
30925 if (likely(PyLong_Check(x))) {
30927 #if CYTHON_USE_PYLONG_INTERNALS
30928 const digit* digits = ((PyLongObject*)x)->ob_digit;
30929 switch (Py_SIZE(x)) {
30930 case 0:
return (
int) 0;
30931 case 1: __PYX_VERIFY_RETURN_INT(
int, digit, digits[0])
30933 if (8 *
sizeof(
int) > 1 * PyLong_SHIFT) {
30934 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
30935 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
30936 }
else if (8 *
sizeof(
int) >= 2 * PyLong_SHIFT) {
30937 return (
int) (((((int)digits[1]) << PyLong_SHIFT) | (
int)digits[0]));
30942 if (8 *
sizeof(
int) > 2 * PyLong_SHIFT) {
30943 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
30944 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
30945 }
else if (8 *
sizeof(
int) >= 3 * PyLong_SHIFT) {
30946 return (
int) (((((((int)digits[2]) << PyLong_SHIFT) | (
int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
30951 if (8 *
sizeof(
int) > 3 * PyLong_SHIFT) {
30952 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
30953 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
30954 }
else if (8 *
sizeof(
int) >= 4 * PyLong_SHIFT) {
30955 return (
int) (((((((((int)digits[3]) << PyLong_SHIFT) | (
int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (
int)digits[0]));
30961 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7
30962 if (unlikely(Py_SIZE(x) < 0)) {
30963 goto raise_neg_overflow;
30967 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
30968 if (unlikely(result < 0))
30970 if (unlikely(result == 1))
30971 goto raise_neg_overflow;
30974 if (
sizeof(
int) <=
sizeof(
unsigned long)) {
30975 __PYX_VERIFY_RETURN_INT_EXC(
int,
unsigned long, PyLong_AsUnsignedLong(x))
30976 #ifdef HAVE_LONG_LONG
30977 }
else if (
sizeof(
int) <=
sizeof(
unsigned PY_LONG_LONG)) {
30978 __PYX_VERIFY_RETURN_INT_EXC(
int,
unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
30982 #if CYTHON_USE_PYLONG_INTERNALS
30983 const digit* digits = ((PyLongObject*)x)->ob_digit;
30984 switch (Py_SIZE(x)) {
30985 case 0:
return (
int) 0;
30986 case -1: __PYX_VERIFY_RETURN_INT(
int, sdigit, (sdigit) (-(sdigit)digits[0]))
30987 case 1: __PYX_VERIFY_RETURN_INT(
int, digit, +digits[0])
30989 if (8 *
sizeof(
int) - 1 > 1 * PyLong_SHIFT) {
30990 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
30991 __PYX_VERIFY_RETURN_INT(
int,
long, -(
long) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
30992 }
else if (8 *
sizeof(
int) - 1 > 2 * PyLong_SHIFT) {
30993 return (
int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (
int)digits[0])));
30998 if (8 *
sizeof(
int) > 1 * PyLong_SHIFT) {
30999 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
31000 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
31001 }
else if (8 *
sizeof(
int) - 1 > 2 * PyLong_SHIFT) {
31002 return (
int) ((((((int)digits[1]) << PyLong_SHIFT) | (
int)digits[0])));
31007 if (8 *
sizeof(
int) - 1 > 2 * PyLong_SHIFT) {
31008 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
31009 __PYX_VERIFY_RETURN_INT(
int,
long, -(
long) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
31010 }
else if (8 *
sizeof(
int) - 1 > 3 * PyLong_SHIFT) {
31011 return (
int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (
int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
31016 if (8 *
sizeof(
int) > 2 * PyLong_SHIFT) {
31017 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
31018 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
31019 }
else if (8 *
sizeof(
int) - 1 > 3 * PyLong_SHIFT) {
31020 return (
int) ((((((((int)digits[2]) << PyLong_SHIFT) | (
int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
31025 if (8 *
sizeof(
int) - 1 > 3 * PyLong_SHIFT) {
31026 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
31027 __PYX_VERIFY_RETURN_INT(
int,
long, -(
long) (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
31028 }
else if (8 *
sizeof(
int) - 1 > 4 * PyLong_SHIFT) {
31029 return (
int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (
int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (
int)digits[0])));
31034 if (8 *
sizeof(
int) > 3 * PyLong_SHIFT) {
31035 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
31036 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
31037 }
else if (8 *
sizeof(
int) - 1 > 4 * PyLong_SHIFT) {
31038 return (
int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (
int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (
int)digits[0])));
31044 if (
sizeof(
int) <=
sizeof(long)) {
31045 __PYX_VERIFY_RETURN_INT_EXC(
int,
long, PyLong_AsLong(x))
31046 #ifdef HAVE_LONG_LONG
31047 }
else if (
sizeof(
int) <=
sizeof(PY_LONG_LONG)) {
31048 __PYX_VERIFY_RETURN_INT_EXC(
int, PY_LONG_LONG, PyLong_AsLongLong(x))
31053 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
31054 PyErr_SetString(PyExc_RuntimeError,
31055 "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
31058 PyObject *v = __Pyx_PyNumber_IntOrLong(x);
31059 #if PY_MAJOR_VERSION < 3
31060 if (likely(v) && !PyLong_Check(v)) {
31062 v = PyNumber_Long(tmp);
31067 int one = 1;
int is_little = (int)*(
unsigned char *)&one;
31068 unsigned char *bytes = (
unsigned char *)&val;
31069 int ret = _PyLong_AsByteArray((PyLongObject *)v,
31070 bytes,
sizeof(val),
31071 is_little, !is_unsigned);
31081 PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
31082 if (!tmp)
return (
int) -1;
31083 val = __Pyx_PyInt_As_int(tmp);
31088 PyErr_SetString(PyExc_OverflowError,
31089 "value too large to convert to int");
31091 raise_neg_overflow:
31092 PyErr_SetString(PyExc_OverflowError,
31093 "can't convert negative value to int");
31098 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(
int value) {
31099 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
31100 #pragma GCC diagnostic push
31101 #pragma GCC diagnostic ignored "-Wconversion"
31103 const int neg_one = (int) -1, const_zero = (
int) 0;
31104 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
31105 #pragma GCC diagnostic pop
31107 const int is_unsigned = neg_one > const_zero;
31109 if (
sizeof(
int) <
sizeof(long)) {
31110 return PyInt_FromLong((
long) value);
31111 }
else if (
sizeof(
int) <=
sizeof(
unsigned long)) {
31112 return PyLong_FromUnsignedLong((
unsigned long) value);
31113 #ifdef HAVE_LONG_LONG
31114 }
else if (
sizeof(
int) <=
sizeof(
unsigned PY_LONG_LONG)) {
31115 return PyLong_FromUnsignedLongLong((
unsigned PY_LONG_LONG) value);
31119 if (
sizeof(
int) <=
sizeof(
long)) {
31120 return PyInt_FromLong((
long) value);
31121 #ifdef HAVE_LONG_LONG
31122 }
else if (
sizeof(
int) <=
sizeof(PY_LONG_LONG)) {
31123 return PyLong_FromLongLong((PY_LONG_LONG) value);
31128 int one = 1;
int little = (int)*(
unsigned char *)&one;
31129 unsigned char *bytes = (
unsigned char *)&value;
31130 return _PyLong_FromByteArray(bytes,
sizeof(
int),
31131 little, !is_unsigned);
31136 static CYTHON_INLINE
long __Pyx_PyInt_As_long(PyObject *x) {
31137 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
31138 #pragma GCC diagnostic push
31139 #pragma GCC diagnostic ignored "-Wconversion"
31141 const long neg_one = (long) -1, const_zero = (
long) 0;
31142 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
31143 #pragma GCC diagnostic pop
31145 const int is_unsigned = neg_one > const_zero;
31146 #if PY_MAJOR_VERSION < 3
31147 if (likely(PyInt_Check(x))) {
31148 if (
sizeof(
long) <
sizeof(long)) {
31149 __PYX_VERIFY_RETURN_INT(
long,
long, PyInt_AS_LONG(x))
31151 long val = PyInt_AS_LONG(x);
31152 if (is_unsigned && unlikely(val < 0)) {
31153 goto raise_neg_overflow;
31159 if (likely(PyLong_Check(x))) {
31161 #if CYTHON_USE_PYLONG_INTERNALS
31162 const digit* digits = ((PyLongObject*)x)->ob_digit;
31163 switch (Py_SIZE(x)) {
31164 case 0:
return (
long) 0;
31165 case 1: __PYX_VERIFY_RETURN_INT(
long, digit, digits[0])
31167 if (8 *
sizeof(
long) > 1 * PyLong_SHIFT) {
31168 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
31169 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
31170 }
else if (8 *
sizeof(
long) >= 2 * PyLong_SHIFT) {
31171 return (
long) (((((long)digits[1]) << PyLong_SHIFT) | (
long)digits[0]));
31176 if (8 *
sizeof(
long) > 2 * PyLong_SHIFT) {
31177 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
31178 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
31179 }
else if (8 *
sizeof(
long) >= 3 * PyLong_SHIFT) {
31180 return (
long) (((((((long)digits[2]) << PyLong_SHIFT) | (
long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
31185 if (8 *
sizeof(
long) > 3 * PyLong_SHIFT) {
31186 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
31187 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
31188 }
else if (8 *
sizeof(
long) >= 4 * PyLong_SHIFT) {
31189 return (
long) (((((((((long)digits[3]) << PyLong_SHIFT) | (
long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (
long)digits[0]));
31195 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7
31196 if (unlikely(Py_SIZE(x) < 0)) {
31197 goto raise_neg_overflow;
31201 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
31202 if (unlikely(result < 0))
31204 if (unlikely(result == 1))
31205 goto raise_neg_overflow;
31208 if (
sizeof(
long) <=
sizeof(
unsigned long)) {
31209 __PYX_VERIFY_RETURN_INT_EXC(
long,
unsigned long, PyLong_AsUnsignedLong(x))
31210 #ifdef HAVE_LONG_LONG
31211 }
else if (
sizeof(
long) <=
sizeof(
unsigned PY_LONG_LONG)) {
31212 __PYX_VERIFY_RETURN_INT_EXC(
long,
unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
31216 #if CYTHON_USE_PYLONG_INTERNALS
31217 const digit* digits = ((PyLongObject*)x)->ob_digit;
31218 switch (Py_SIZE(x)) {
31219 case 0:
return (
long) 0;
31220 case -1: __PYX_VERIFY_RETURN_INT(
long, sdigit, (sdigit) (-(sdigit)digits[0]))
31221 case 1: __PYX_VERIFY_RETURN_INT(
long, digit, +digits[0])
31223 if (8 *
sizeof(
long) - 1 > 1 * PyLong_SHIFT) {
31224 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
31225 __PYX_VERIFY_RETURN_INT(
long,
long, -(
long) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
31226 }
else if (8 *
sizeof(
long) - 1 > 2 * PyLong_SHIFT) {
31227 return (
long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (
long)digits[0])));
31232 if (8 *
sizeof(
long) > 1 * PyLong_SHIFT) {
31233 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
31234 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
31235 }
else if (8 *
sizeof(
long) - 1 > 2 * PyLong_SHIFT) {
31236 return (
long) ((((((long)digits[1]) << PyLong_SHIFT) | (
long)digits[0])));
31241 if (8 *
sizeof(
long) - 1 > 2 * PyLong_SHIFT) {
31242 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
31243 __PYX_VERIFY_RETURN_INT(
long,
long, -(
long) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
31244 }
else if (8 *
sizeof(
long) - 1 > 3 * PyLong_SHIFT) {
31245 return (
long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (
long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
31250 if (8 *
sizeof(
long) > 2 * PyLong_SHIFT) {
31251 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
31252 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
31253 }
else if (8 *
sizeof(
long) - 1 > 3 * PyLong_SHIFT) {
31254 return (
long) ((((((((long)digits[2]) << PyLong_SHIFT) | (
long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
31259 if (8 *
sizeof(
long) - 1 > 3 * PyLong_SHIFT) {
31260 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
31261 __PYX_VERIFY_RETURN_INT(
long,
long, -(
long) (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
31262 }
else if (8 *
sizeof(
long) - 1 > 4 * PyLong_SHIFT) {
31263 return (
long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (
long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (
long)digits[0])));
31268 if (8 *
sizeof(
long) > 3 * PyLong_SHIFT) {
31269 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
31270 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
31271 }
else if (8 *
sizeof(
long) - 1 > 4 * PyLong_SHIFT) {
31272 return (
long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (
long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (
long)digits[0])));
31278 if (
sizeof(
long) <=
sizeof(long)) {
31279 __PYX_VERIFY_RETURN_INT_EXC(
long,
long, PyLong_AsLong(x))
31280 #ifdef HAVE_LONG_LONG
31281 }
else if (
sizeof(
long) <=
sizeof(PY_LONG_LONG)) {
31282 __PYX_VERIFY_RETURN_INT_EXC(
long, PY_LONG_LONG, PyLong_AsLongLong(x))
31287 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
31288 PyErr_SetString(PyExc_RuntimeError,
31289 "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
31292 PyObject *v = __Pyx_PyNumber_IntOrLong(x);
31293 #if PY_MAJOR_VERSION < 3
31294 if (likely(v) && !PyLong_Check(v)) {
31296 v = PyNumber_Long(tmp);
31301 int one = 1;
int is_little = (int)*(
unsigned char *)&one;
31302 unsigned char *bytes = (
unsigned char *)&val;
31303 int ret = _PyLong_AsByteArray((PyLongObject *)v,
31304 bytes,
sizeof(val),
31305 is_little, !is_unsigned);
31315 PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
31316 if (!tmp)
return (
long) -1;
31317 val = __Pyx_PyInt_As_long(tmp);
31322 PyErr_SetString(PyExc_OverflowError,
31323 "value too large to convert to long");
31325 raise_neg_overflow:
31326 PyErr_SetString(PyExc_OverflowError,
31327 "can't convert negative value to long");
31332 static CYTHON_INLINE
char __Pyx_PyInt_As_char(PyObject *x) {
31333 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
31334 #pragma GCC diagnostic push
31335 #pragma GCC diagnostic ignored "-Wconversion"
31337 const char neg_one = (char) -1, const_zero = (
char) 0;
31338 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
31339 #pragma GCC diagnostic pop
31341 const int is_unsigned = neg_one > const_zero;
31342 #if PY_MAJOR_VERSION < 3
31343 if (likely(PyInt_Check(x))) {
31344 if (
sizeof(
char) <
sizeof(long)) {
31345 __PYX_VERIFY_RETURN_INT(
char,
long, PyInt_AS_LONG(x))
31347 long val = PyInt_AS_LONG(x);
31348 if (is_unsigned && unlikely(val < 0)) {
31349 goto raise_neg_overflow;
31355 if (likely(PyLong_Check(x))) {
31357 #if CYTHON_USE_PYLONG_INTERNALS
31358 const digit* digits = ((PyLongObject*)x)->ob_digit;
31359 switch (Py_SIZE(x)) {
31360 case 0:
return (
char) 0;
31361 case 1: __PYX_VERIFY_RETURN_INT(
char, digit, digits[0])
31363 if (8 *
sizeof(
char) > 1 * PyLong_SHIFT) {
31364 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
31365 __PYX_VERIFY_RETURN_INT(
char,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
31366 }
else if (8 *
sizeof(
char) >= 2 * PyLong_SHIFT) {
31367 return (
char) (((((char)digits[1]) << PyLong_SHIFT) | (
char)digits[0]));
31372 if (8 *
sizeof(
char) > 2 * PyLong_SHIFT) {
31373 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
31374 __PYX_VERIFY_RETURN_INT(
char,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
31375 }
else if (8 *
sizeof(
char) >= 3 * PyLong_SHIFT) {
31376 return (
char) (((((((char)digits[2]) << PyLong_SHIFT) | (
char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
31381 if (8 *
sizeof(
char) > 3 * PyLong_SHIFT) {
31382 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
31383 __PYX_VERIFY_RETURN_INT(
char,
unsigned long, (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
31384 }
else if (8 *
sizeof(
char) >= 4 * PyLong_SHIFT) {
31385 return (
char) (((((((((char)digits[3]) << PyLong_SHIFT) | (
char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (
char)digits[0]));
31391 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7
31392 if (unlikely(Py_SIZE(x) < 0)) {
31393 goto raise_neg_overflow;
31397 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
31398 if (unlikely(result < 0))
31400 if (unlikely(result == 1))
31401 goto raise_neg_overflow;
31404 if (
sizeof(
char) <=
sizeof(
unsigned long)) {
31405 __PYX_VERIFY_RETURN_INT_EXC(
char,
unsigned long, PyLong_AsUnsignedLong(x))
31406 #ifdef HAVE_LONG_LONG
31407 }
else if (
sizeof(
char) <=
sizeof(
unsigned PY_LONG_LONG)) {
31408 __PYX_VERIFY_RETURN_INT_EXC(
char,
unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
31412 #if CYTHON_USE_PYLONG_INTERNALS
31413 const digit* digits = ((PyLongObject*)x)->ob_digit;
31414 switch (Py_SIZE(x)) {
31415 case 0:
return (
char) 0;
31416 case -1: __PYX_VERIFY_RETURN_INT(
char, sdigit, (sdigit) (-(sdigit)digits[0]))
31417 case 1: __PYX_VERIFY_RETURN_INT(
char, digit, +digits[0])
31419 if (8 *
sizeof(
char) - 1 > 1 * PyLong_SHIFT) {
31420 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
31421 __PYX_VERIFY_RETURN_INT(
char,
long, -(
long) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
31422 }
else if (8 *
sizeof(
char) - 1 > 2 * PyLong_SHIFT) {
31423 return (
char) (((char)-1)*(((((char)digits[1]) << PyLong_SHIFT) | (
char)digits[0])));
31428 if (8 *
sizeof(
char) > 1 * PyLong_SHIFT) {
31429 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
31430 __PYX_VERIFY_RETURN_INT(
char,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
31431 }
else if (8 *
sizeof(
char) - 1 > 2 * PyLong_SHIFT) {
31432 return (
char) ((((((char)digits[1]) << PyLong_SHIFT) | (
char)digits[0])));
31437 if (8 *
sizeof(
char) - 1 > 2 * PyLong_SHIFT) {
31438 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
31439 __PYX_VERIFY_RETURN_INT(
char,
long, -(
long) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
31440 }
else if (8 *
sizeof(
char) - 1 > 3 * PyLong_SHIFT) {
31441 return (
char) (((char)-1)*(((((((char)digits[2]) << PyLong_SHIFT) | (
char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
31446 if (8 *
sizeof(
char) > 2 * PyLong_SHIFT) {
31447 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
31448 __PYX_VERIFY_RETURN_INT(
char,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
31449 }
else if (8 *
sizeof(
char) - 1 > 3 * PyLong_SHIFT) {
31450 return (
char) ((((((((char)digits[2]) << PyLong_SHIFT) | (
char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
31455 if (8 *
sizeof(
char) - 1 > 3 * PyLong_SHIFT) {
31456 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
31457 __PYX_VERIFY_RETURN_INT(
char,
long, -(
long) (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
31458 }
else if (8 *
sizeof(
char) - 1 > 4 * PyLong_SHIFT) {
31459 return (
char) (((char)-1)*(((((((((char)digits[3]) << PyLong_SHIFT) | (
char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (
char)digits[0])));
31464 if (8 *
sizeof(
char) > 3 * PyLong_SHIFT) {
31465 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
31466 __PYX_VERIFY_RETURN_INT(
char,
unsigned long, (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
31467 }
else if (8 *
sizeof(
char) - 1 > 4 * PyLong_SHIFT) {
31468 return (
char) ((((((((((char)digits[3]) << PyLong_SHIFT) | (
char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (
char)digits[0])));
31474 if (
sizeof(
char) <=
sizeof(long)) {
31475 __PYX_VERIFY_RETURN_INT_EXC(
char,
long, PyLong_AsLong(x))
31476 #ifdef HAVE_LONG_LONG
31477 }
else if (
sizeof(
char) <=
sizeof(PY_LONG_LONG)) {
31478 __PYX_VERIFY_RETURN_INT_EXC(
char, PY_LONG_LONG, PyLong_AsLongLong(x))
31483 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
31484 PyErr_SetString(PyExc_RuntimeError,
31485 "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
31488 PyObject *v = __Pyx_PyNumber_IntOrLong(x);
31489 #if PY_MAJOR_VERSION < 3
31490 if (likely(v) && !PyLong_Check(v)) {
31492 v = PyNumber_Long(tmp);
31497 int one = 1;
int is_little = (int)*(
unsigned char *)&one;
31498 unsigned char *bytes = (
unsigned char *)&val;
31499 int ret = _PyLong_AsByteArray((PyLongObject *)v,
31500 bytes,
sizeof(val),
31501 is_little, !is_unsigned);
31511 PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
31512 if (!tmp)
return (
char) -1;
31513 val = __Pyx_PyInt_As_char(tmp);
31518 PyErr_SetString(PyExc_OverflowError,
31519 "value too large to convert to char");
31521 raise_neg_overflow:
31522 PyErr_SetString(PyExc_OverflowError,
31523 "can't convert negative value to char");
31528 static int __Pyx_check_binary_version(
void) {
31530 int same=1, i, found_dot;
31531 const char* rt_from_call = Py_GetVersion();
31532 PyOS_snprintf(ctversion, 5,
"%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
31534 for (i = 0; i < 4; i++) {
31535 if (!ctversion[i]) {
31536 same = (rt_from_call[i] <
'0' || rt_from_call[i] >
'9');
31539 if (rt_from_call[i] != ctversion[i]) {
31545 char rtversion[5] = {
'\0'};
31547 for (i=0; i<4; ++i) {
31548 if (rt_from_call[i] ==
'.') {
31549 if (found_dot)
break;
31551 }
else if (rt_from_call[i] <
'0' || rt_from_call[i] >
'9') {
31554 rtversion[i] = rt_from_call[i];
31556 PyOS_snprintf(message,
sizeof(message),
31557 "compiletime version %s of module '%.100s' "
31558 "does not match runtime version %s",
31559 ctversion, __Pyx_MODULE_NAME, rtversion);
31560 return PyErr_WarnEx(NULL, message, 1);
31566 #ifndef __PYX_HAVE_RT_ImportFunction_0_29_36
31567 #define __PYX_HAVE_RT_ImportFunction_0_29_36
31568 static int __Pyx_ImportFunction_0_29_36(PyObject *module,
const char *funcname,
void (**f)(
void),
const char *sig) {
31570 PyObject *cobj = 0;
31575 d = PyObject_GetAttrString(module, (
char *)
"__pyx_capi__");
31578 cobj = PyDict_GetItemString(d, funcname);
31580 PyErr_Format(PyExc_ImportError,
31581 "%.200s does not export expected C function %.200s",
31582 PyModule_GetName(module), funcname);
31585 #if PY_VERSION_HEX >= 0x02070000
31586 if (!PyCapsule_IsValid(cobj, sig)) {
31587 PyErr_Format(PyExc_TypeError,
31588 "C function %.200s.%.200s has wrong signature (expected %.500s, got %.500s)",
31589 PyModule_GetName(module), funcname, sig, PyCapsule_GetName(cobj));
31592 tmp.p = PyCapsule_GetPointer(cobj, sig);
31594 {
const char *desc, *s1, *s2;
31595 desc = (
const char *)PyCObject_GetDesc(cobj);
31598 s1 = desc; s2 = sig;
31599 while (*s1 !=
'\0' && *s1 == *s2) { s1++; s2++; }
31601 PyErr_Format(PyExc_TypeError,
31602 "C function %.200s.%.200s has wrong signature (expected %.500s, got %.500s)",
31603 PyModule_GetName(module), funcname, sig, desc);
31606 tmp.p = PyCObject_AsVoidPtr(cobj);}
31620 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
31622 #if PY_MAJOR_VERSION < 3
31623 if (t->is_unicode) {
31624 *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
31625 }
else if (t->intern) {
31626 *t->p = PyString_InternFromString(t->s);
31628 *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
31631 if (t->is_unicode | t->is_str) {
31633 *t->p = PyUnicode_InternFromString(t->s);
31634 }
else if (t->encoding) {
31635 *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL);
31637 *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
31640 *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
31645 if (PyObject_Hash(*t->p) == -1)
31652 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(
const char* c_str) {
31653 return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str));
31655 static CYTHON_INLINE
const char* __Pyx_PyObject_AsString(PyObject* o) {
31657 return __Pyx_PyObject_AsStringAndSize(o, &ignore);
31659 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
31660 #if !CYTHON_PEP393_ENABLED
31661 static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
31663 PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
31664 if (!defenc)
return NULL;
31665 defenc_c = PyBytes_AS_STRING(defenc);
31666 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
31668 char* end = defenc_c + PyBytes_GET_SIZE(defenc);
31670 for (c = defenc_c; c < end; c++) {
31671 if ((
unsigned char) (*c) >= 128) {
31672 PyUnicode_AsASCIIString(o);
31678 *length = PyBytes_GET_SIZE(defenc);
31682 static CYTHON_INLINE
const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
31683 if (unlikely(__Pyx_PyUnicode_READY(o) == -1))
return NULL;
31684 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
31685 if (likely(PyUnicode_IS_ASCII(o))) {
31686 *length = PyUnicode_GET_LENGTH(o);
31687 return PyUnicode_AsUTF8(o);
31689 PyUnicode_AsASCIIString(o);
31693 return PyUnicode_AsUTF8AndSize(o, length);
31698 static CYTHON_INLINE
const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
31699 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
31701 #
if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
31702 __Pyx_sys_getdefaultencoding_not_ascii &&
31704 PyUnicode_Check(o)) {
31705 return __Pyx_PyUnicode_AsStringAndSize(o, length);
31708 #if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))
31709 if (PyByteArray_Check(o)) {
31710 *length = PyByteArray_GET_SIZE(o);
31711 return PyByteArray_AS_STRING(o);
31716 int r = PyBytes_AsStringAndSize(o, &result, length);
31717 if (unlikely(r < 0)) {
31724 static CYTHON_INLINE
int __Pyx_PyObject_IsTrue(PyObject* x) {
31725 int is_true = x == Py_True;
31726 if (is_true | (x == Py_False) | (x == Py_None))
return is_true;
31727 else return PyObject_IsTrue(x);
31729 static CYTHON_INLINE
int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) {
31731 if (unlikely(!x))
return -1;
31732 retval = __Pyx_PyObject_IsTrue(x);
31736 static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result,
const char* type_name) {
31737 #if PY_MAJOR_VERSION >= 3
31738 if (PyLong_Check(result)) {
31739 if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
31740 "__int__ returned non-int (type %.200s). "
31741 "The ability to return an instance of a strict subclass of int "
31742 "is deprecated, and may be removed in a future version of Python.",
31743 Py_TYPE(result)->tp_name)) {
31750 PyErr_Format(PyExc_TypeError,
31751 "__%.4s__ returned non-%.4s (type %.200s)",
31752 type_name, type_name, Py_TYPE(result)->tp_name);
31756 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
31757 #if CYTHON_USE_TYPE_SLOTS
31758 PyNumberMethods *m;
31760 const char *name = NULL;
31761 PyObject *res = NULL;
31762 #if PY_MAJOR_VERSION < 3
31763 if (likely(PyInt_Check(x) || PyLong_Check(x)))
31765 if (likely(PyLong_Check(x)))
31767 return __Pyx_NewRef(x);
31768 #if CYTHON_USE_TYPE_SLOTS
31769 m = Py_TYPE(x)->tp_as_number;
31770 #if PY_MAJOR_VERSION < 3
31771 if (m && m->nb_int) {
31773 res = m->nb_int(x);
31775 else if (m && m->nb_long) {
31777 res = m->nb_long(x);
31780 if (likely(m && m->nb_int)) {
31782 res = m->nb_int(x);
31786 if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) {
31787 res = PyNumber_Int(x);
31791 #if PY_MAJOR_VERSION < 3
31792 if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) {
31794 if (unlikely(!PyLong_CheckExact(res))) {
31796 return __Pyx_PyNumber_IntOrLongWrongResultType(res, name);
31799 else if (!PyErr_Occurred()) {
31800 PyErr_SetString(PyExc_TypeError,
31801 "an integer is required");
31805 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
31808 #if PY_MAJOR_VERSION < 3
31809 if (likely(PyInt_CheckExact(b))) {
31810 if (
sizeof(Py_ssize_t) >=
sizeof(
long))
31811 return PyInt_AS_LONG(b);
31813 return PyInt_AsSsize_t(b);
31816 if (likely(PyLong_CheckExact(b))) {
31817 #if CYTHON_USE_PYLONG_INTERNALS
31818 const digit* digits = ((PyLongObject*)b)->ob_digit;
31819 const Py_ssize_t size = Py_SIZE(b);
31820 if (likely(__Pyx_sst_abs(size) <= 1)) {
31821 ival = likely(size) ? digits[0] : 0;
31822 if (size == -1) ival = -ival;
31827 if (8 *
sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
31828 return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (
size_t)digits[0]));
31832 if (8 *
sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
31833 return -(Py_ssize_t) (((((
size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
31837 if (8 *
sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
31838 return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (
size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
31842 if (8 *
sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
31843 return -(Py_ssize_t) (((((((
size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (
size_t)digits[0]));
31847 if (8 *
sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
31848 return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (
size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (
size_t)digits[0]));
31852 if (8 *
sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
31853 return -(Py_ssize_t) (((((((((
size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (
size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
31859 return PyLong_AsSsize_t(b);
31861 x = PyNumber_Index(b);
31863 ival = PyInt_AsSsize_t(x);
31867 static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject* o) {
31868 if (
sizeof(Py_hash_t) ==
sizeof(Py_ssize_t)) {
31869 return (Py_hash_t) __Pyx_PyIndex_AsSsize_t(o);
31870 #if PY_MAJOR_VERSION < 3
31871 }
else if (likely(PyInt_CheckExact(o))) {
31872 return PyInt_AS_LONG(o);
31877 x = PyNumber_Index(o);
31879 ival = PyInt_AsLong(x);
31884 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(
long b) {
31885 return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False);
31887 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(
size_t ival) {
31888 return PyInt_FromSize_t(ival);
static DataType inner_product(const DataType *vector1, const DataType *vector2, const LongIndexType vector_size)
Computes Euclidean inner product of two vectors.